diff --git a/src/Models/Library.php b/src/Models/Library.php index d11ea63..42a348b 100644 --- a/src/Models/Library.php +++ b/src/Models/Library.php @@ -5,6 +5,7 @@ use Database\Factories\LibraryFactory; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Collection; use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\MediaLibrary\MediaCollections\Models\Collections\MediaCollection; @@ -58,12 +59,12 @@ public function theFile(): ?string return $this->file_path; } - public function getFiles(): ?MediaCollection + public function getFiles(): MediaCollection|Collection { if (! $this->getMedia('library')->isEmpty()) { return $this->getMedia('library'); } - return null; + return collect(); } }