Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
peripherad
/
vendor
/
spatie
/
laravel-medialibrary
/
src
/
Support
/
UrlGenerator
:
DefaultUrlGenerator.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace Spatie\MediaLibrary\Support\UrlGenerator; use DateTimeInterface; use Illuminate\Support\Str; class DefaultUrlGenerator extends BaseUrlGenerator { public function getUrl(): string { $url = $this->getDisk()->url($this->getPathRelativeToRoot()); return $this->versionUrl($url); } public function getTemporaryUrl(DateTimeInterface $expiration, array $options = []): string { return $this->getDisk()->temporaryUrl($this->getPathRelativeToRoot(), $expiration, $options); } public function getBaseMediaDirectoryUrl(): string { return $this->getDisk()->url('/'); } public function getPath(): string { return $this->getRootOfDisk().$this->getPathRelativeToRoot(); } public function getResponsiveImagesDirectoryUrl(): string { $path = $this->pathGenerator->getPathForResponsiveImages($this->media); return Str::finish($this->getDisk()->url($path), '/'); } protected function getRootOfDisk(): string { return $this->getDisk()->path('/'); } }