Remove the url generator

This commit is contained in:
Nabeel Shahzad 2018-04-04 08:46:46 -05:00
parent 9ff3c1ab10
commit 7a3a2f3e9a

View File

@ -1,49 +0,0 @@
<?php
/**
*
*/
namespace App\Support\Media;
use DateTimeInterface;
use Spatie\MediaLibrary\Exceptions\UrlCannotBeDetermined;
use Spatie\MediaLibrary\UrlGenerator\BaseUrlGenerator;
/**
* Class PublicUrlGenerator
* @package App\Support\Media
*/
class PublicUrlGenerator extends BaseUrlGenerator
{
/**
* Get the url for the profile of a media item.
* @return string
*/
public function getUrl(): string
{
return public_asset($this->getPathRelativeToRoot());
}
/**
* Get the temporary url for a media item.
*
* @param DateTimeInterface $expiration
* @param array $options
*
* @return string
*/
public function getTemporaryUrl(DateTimeInterface $expiration, array $options = []): string
{
throw UrlCannotBeDetermined::filesystemDoesNotSupportTemporaryUrls();
}
/**
* Get the url to the directory containing responsive images.
*
* @return string
*/
public function getResponsiveImagesDirectoryUrl(): string
{
return public_asset('/').'/'.$this->pathGenerator->getPathForResponsiveImages($this->media);
}
}