@@ -47,7 +47,7 @@ |
||
| 47 | 47 | * |
| 48 | 48 | * @param string $name |
| 49 | 49 | * |
| 50 | - * @return mixed |
|
| 50 | + * @return Conversion |
|
| 51 | 51 | * |
| 52 | 52 | * @throws \Spatie\MediaLibrary\Exceptions\InvalidConversion |
| 53 | 53 | */ |
@@ -32,6 +32,9 @@ discard block |
||
| 32 | 32 | app(FileManipulator::class)->createDerivedFiles($media); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param string $type |
|
| 37 | + */ |
|
| 35 | 38 | public function copyToMediaLibrary(string $pathToFile, Media $media, ?string $type = null, ?string $targetFileName = null) |
| 36 | 39 | { |
| 37 | 40 | $destinationFileName = $targetFileName ?: pathinfo($pathToFile, PATHINFO_BASENAME); |
@@ -73,6 +76,9 @@ discard block |
||
| 73 | 76 | return array_merge($mimeTypeHeader, $extraHeaders, $this->customRemoteHeaders, $mediaCustomHeaders); |
| 74 | 77 | } |
| 75 | 78 | |
| 79 | + /** |
|
| 80 | + * @return resource |
|
| 81 | + */ |
|
| 76 | 82 | public function getStream(Media $media) |
| 77 | 83 | { |
| 78 | 84 | $sourceFile = $this->getMediaDirectory($media).'/'.$media->file_name; |
@@ -2,12 +2,12 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Spatie\MediaLibrary\Filesystem; |
| 4 | 4 | |
| 5 | -use Spatie\MediaLibrary\Helpers\File; |
|
| 6 | -use Spatie\MediaLibrary\Models\Media; |
|
| 7 | -use Spatie\MediaLibrary\FileManipulator; |
|
| 8 | 5 | use Illuminate\Contracts\Filesystem\Factory; |
| 9 | -use Spatie\MediaLibrary\Events\MediaHasBeenAdded; |
|
| 10 | 6 | use Spatie\MediaLibrary\Conversion\ConversionCollection; |
| 7 | +use Spatie\MediaLibrary\Events\MediaHasBeenAdded; |
|
| 8 | +use Spatie\MediaLibrary\FileManipulator; |
|
| 9 | +use Spatie\MediaLibrary\Helpers\File; |
|
| 10 | +use Spatie\MediaLibrary\Models\Media; |
|
| 11 | 11 | use Spatie\MediaLibrary\PathGenerator\PathGeneratorFactory; |
| 12 | 12 | |
| 13 | 13 | class Filesystem |
@@ -5,10 +5,10 @@ |
||
| 5 | 5 | use Illuminate\Support\ServiceProvider; |
| 6 | 6 | use Spatie\MediaLibrary\Commands\CleanCommand; |
| 7 | 7 | use Spatie\MediaLibrary\Commands\ClearCommand; |
| 8 | -use Spatie\MediaLibrary\Filesystem\Filesystem; |
|
| 9 | 8 | use Spatie\MediaLibrary\Commands\RegenerateCommand; |
| 10 | -use Spatie\MediaLibrary\ResponsiveImages\WidthCalculator\WidthCalculator; |
|
| 9 | +use Spatie\MediaLibrary\Filesystem\Filesystem; |
|
| 11 | 10 | use Spatie\MediaLibrary\ResponsiveImages\TinyPlaceholderGenerator\TinyPlaceholderGenerator; |
| 11 | +use Spatie\MediaLibrary\ResponsiveImages\WidthCalculator\WidthCalculator; |
|
| 12 | 12 | |
| 13 | 13 | class MediaLibraryServiceProvider extends ServiceProvider |
| 14 | 14 | { |