for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Xetaravel\MediaLibrary\PathGenerator;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\MediaLibrary\Support\PathGenerator\PathGenerator;
class XetaravelPathGenerator implements PathGenerator
{
/**
* Get the path for the given media, relative to the root storage path.
*
* @param Media $media
* @return string
*/
public function getPath(Media $media): string
return $media->collection_name . '/' . $media->id . '/';
}
* Get the path for conversions of the given media, relative to the root storage path.
public function getPathForConversions(Media $media): string
return $this->getPath($media) . 'conversions/';
* Get the path for responsive images of the given media, relative to the root storage path.
public function getPathForResponsiveImages(Media $media): string