src/Charcoal/Admin/Property/Input/FileInput.php
public function previewVal()
    {
        $val = parent::inputVal();
        if (empty($val)) {
            return '';
        }

        $parts = parse_url($val);
        if (empty($parts['scheme']) && !in_array($val[0], [ '/', '#', '?' ])) {
            $path  = isset($parts['path']) ? ltrim($parts['path'], '/') : '';
            $query = isset($parts['query']) ? $parts['query'] : '';
            $hash  = isset($parts['fragment']) ? $parts['fragment'] : '';
            $val   = $this->baseUrl->withPath($path)->withQuery($query)->withFragment($hash);
        }

        return $val;
    }
public function previewVal()
    {
        $val = parent::inputVal();
        if (empty($val)) {
            return '';
        }

        $parts = parse_url($val);
        if (empty($parts['scheme']) && !in_array($val[0], [ '/', '#', '?' ])) {
            $path  = isset($parts['path']) ? ltrim($parts['path'], '/') : '';
            $query = isset($parts['query']) ? $parts['query'] : '';
            $hash  = isset($parts['fragment']) ? $parts['fragment'] : '';
            $val   = $this->baseUrl->withPath($path)->withQuery($query)->withFragment($hash);
        }

        return $val;
    }
public function previewVal ( ) { $ val = parent :: inputVal ( ) ; if ( empty ( $ val ) ) { return '' ; } $ parts = parse_url ( $ val ) ; if ( empty ( $ parts [ 'scheme' ] ) && ! in_array ( $ val [ 0 ] , [ '/' , '#' , '?' ] ) ) { $ path = isset ( $ parts [ 'path' ] ) ? ltrim ( $ parts [ 'path' ] , '/' ) : '' ; $ query = isset ( $ parts [ 'query' ] ) ? $ parts [ 'query' ] : '' ; $ hash = isset ( $ parts [ 'fragment' ] ) ? $ parts [ 'fragment' ] : '' ; $ val = $ this -> baseUrl -> withPath ( $ path ) -> withQuery ( $ query ) -> withFragment ( $ hash ) ; } return $ val ; }
Retrieve input value for file preview.

@return string
Retrieve input value for file preview .