getPathForConversions() публичный Метод

* Get the path for conversions of the given media, relative to the root storage path.
public getPathForConversions ( Media $media ) : string
$media Spatie\MediaLibrary\Media
Результат string
Пример #1
0
 protected function deleteFilesGeneratedForDeprecatedConversions()
 {
     $this->getMediaItems()->each(function (Media $media) {
         $conversionFilePaths = ConversionCollection::createForMedia($media)->getConversionsFiles($media->collection_name);
         $path = $this->basePathGenerator->getPathForConversions($media);
         $currentFilePaths = $this->fileSystem->disk($media->disk)->files($path);
         collect($currentFilePaths)->filter(function (string $currentFilePath) use($conversionFilePaths) {
             return !$conversionFilePaths->contains(basename($currentFilePath));
         })->each(function (string $currentFilePath) use($media) {
             if (!$this->isDryRun) {
                 $this->fileSystem->disk($media->disk)->delete($currentFilePath);
             }
             $this->info("Deprecated conversion file `{$currentFilePath}` " . ($this->isDryRun ? 'found' : 'has been removed'));
         });
     });
 }