mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 21:11:05 +03:30
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Media\UrlGenerator;
|
|
|
|
use DateTimeInterface;
|
|
use Spatie\MediaLibrary\Support\UrlGenerator\BaseUrlGenerator;
|
|
|
|
class S3UrlGenerator extends BaseUrlGenerator
|
|
{
|
|
/**
|
|
* Get the url for the profile of a media item.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getUrl(): string
|
|
{
|
|
return config('media-library.s3.domain') . '/' . $this->getPathRelativeToRoot();
|
|
}
|
|
|
|
/**
|
|
* @param \DateTimeInterface $expiration
|
|
* @param array $options
|
|
*
|
|
* @return string
|
|
*
|
|
*/
|
|
public function getTemporaryUrl(DateTimeInterface $expiration, array $options = []): string
|
|
{
|
|
|
|
return 'done';
|
|
}
|
|
|
|
/**
|
|
* Get the relative path for the profile of a media item.
|
|
*
|
|
* @return string
|
|
*
|
|
*/
|
|
public function getPath(): string
|
|
{
|
|
return $this->getPathRelativeToRoot();
|
|
}
|
|
|
|
/**
|
|
* Get the url to the directory containing responsive images.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getResponsiveImagesDirectoryUrl(): string
|
|
{
|
|
return config('media-library.s3.domain') . '/' . $this->pathGenerator->getPathForResponsiveImages($this->media);
|
|
}
|
|
}
|