src/UrlGenerators/LocalUrlGenerator.php
public function getPublicPath()
    {
        if (! $this->isPubliclyAccessible()) {
            throw MediaUrlException::mediaNotPubliclyAccessible($this->getAbsolutePath(), public_path());
        }
        if ($this->isInWebroot()) {
            $path = str_replace(public_path(), '', $this->getAbsolutePath());
        } else {
            $path = rtrim($this->getPrefix(), '/').'/'.$this->media->getDiskPath();
        }

        return $this->cleanDirectorySeparators($path);
    }
public function getPublicPath()
    {
        if (! $this->isPubliclyAccessible()) {
            throw MediaUrlException::mediaNotPubliclyAccessible($this->getAbsolutePath(), public_path());
        }
        if ($this->isInWebroot()) {
            $path = str_replace(public_path(), '', $this->getAbsolutePath());
        } else {
            $path = rtrim($this->getPrefix(), '/').'/'.$this->media->getDiskPath();
        }

        return $this->cleanDirectorySeparators($path);
    }
public function getPublicPath ( ) { if ( ! $ this -> isPubliclyAccessible ( ) ) { throw MediaUrlException :: mediaNotPubliclyAccessible ( $ this -> getAbsolutePath ( ) , public_path ( ) ) ; } if ( $ this -> isInWebroot ( ) ) { $ path = str_replace ( public_path ( ) , '' , $ this -> getAbsolutePath ( ) ) ; } else { $ path = rtrim ( $ this -> getPrefix ( ) , '/' ) . '/' . $ this -> media -> getDiskPath ( ) ; } return $ this -> cleanDirectorySeparators ( $ path ) ; }
Get the path to relative to the webroot.
@return string
@throws \Plank\Mediable\Exceptions\MediaUrlException If media's disk is not publicly accessible
Get the path to relative to the webroot .