Spatie\MediaLibrary\Media::getPath PHP Method

getPath() public method

Get the original path to a media-file.
public getPath ( string $conversionName = '' ) : string
$conversionName string
return string
    public function getPath(string $conversionName = '') : string
    {
        $urlGenerator = UrlGeneratorFactory::createForMedia($this);
        if ($conversionName != '') {
            $urlGenerator->setConversion(ConversionCollection::createForMedia($this)->getByName($conversionName));
        }
        return $urlGenerator->getPath();
    }