/var/www/flurhymez/vendor/spatie/laravel-medialibrary/src/Support/UrlGenerator
Edit: /var/www/flurhymez/vendor/spatie/laravel-medialibrary/src/Support/UrlGenerator/BaseUrlGenerator.php (1990B)
config = $config;
}
public function setMedia(Media $media): UrlGenerator
{
$this->media = $media;
return $this;
}
public function setConversion(Conversion $conversion): UrlGenerator
{
$this->conversion = $conversion;
return $this;
}
public function setPathGenerator(PathGenerator $pathGenerator): UrlGenerator
{
$this->pathGenerator = $pathGenerator;
return $this;
}
public function getPathRelativeToRoot(): string
{
if (is_null($this->conversion)) {
return $this->pathGenerator->getPath($this->media).($this->media->file_name);
}
return $this->pathGenerator->getPathForConversions($this->media)
.$this->conversion->getConversionFile($this->media);
}
protected function getDiskName(): string
{
return $this->conversion === null
? $this->media->disk
: $this->media->conversions_disk;
}
protected function getDisk(): Filesystem
{
return Storage::disk($this->getDiskName());
}
public function versionUrl(string $path = ''): string
{
if (! $this->config->get('media-library.version_urls')) {
return $path;
}
return "{$path}?v={$this->media->updated_at->timestamp}";
}
}