diff --git a/src/MediaCollections/FileAdder.php b/src/MediaCollections/FileAdder.php index 67616bae6..2e21ec99f 100644 --- a/src/MediaCollections/FileAdder.php +++ b/src/MediaCollections/FileAdder.php @@ -22,6 +22,9 @@ use Symfony\Component\HttpFoundation\File\File as SymfonyFile; use Symfony\Component\HttpFoundation\File\UploadedFile; +/** + * @template TModel of \Spatie\MediaLibrary\MediaCollections\Models\Media + */ class FileAdder { use Macroable; @@ -214,11 +217,17 @@ public function addCustomHeaders(array $customRemoteHeaders): self return $this; } + /** + * @return TModel + */ public function toMediaCollectionOnCloudDisk(string $collectionName = 'default'): Media { return $this->toMediaCollection($collectionName, config('filesystems.cloud')); } + /** + * @return TModel + */ public function toMediaCollectionFromRemote(string $collectionName = 'default', string $diskName = ''): Media { $storage = Storage::disk($this->file->getDisk()); @@ -270,6 +279,9 @@ public function toMediaCollectionFromRemote(string $collectionName = 'default', return $media; } + /** + * @return TModel + */ public function toMediaCollection(string $collectionName = 'default', string $diskName = ''): Media { $sanitizedFileName = ($this->fileNameSanitizer)($this->fileName); @@ -333,6 +345,9 @@ public function toMediaCollection(string $collectionName = 'default', string $di return $media; } + /** + * @return TModel + */ public function toMediaLibrary(string $collectionName = 'default', string $diskName = ''): Media { return $this->toMediaCollection($collectionName, $diskName);