I encountered an issue where the GalleryJsonMedia package is expecting an array of files, but it is receiving a TemporaryUploadedFile object from Livewire.
GalleryJsonMedia\Form\JsonMediaGallery::GalleryJsonMedia\Form\{closure}(): Argument #1 ($file) must be of type array, Livewire\Features\SupportFileUploads\TemporaryUploadedFile given
What happened?
I encountered an issue where the GalleryJsonMedia package is expecting an array of files, but it is receiving a TemporaryUploadedFile object from Livewire.
How to reproduce the bug
Here's the code that I have used:
JsonMediaGallery::make('images') ->directory('tasks') ->reorderable() ->preserveFilenames() ->maxSize(5 * 1024) ->replaceNameByTitle() ->image() ->downloadable() ->deletable();
I am getting the following error:
GalleryJsonMedia\Form\JsonMediaGallery::GalleryJsonMedia\Form\{closure}(): Argument #1 ($file) must be of type array, Livewire\Features\SupportFileUploads\TemporaryUploadedFile given
Package Version
2.2
PHP Version
8.3.6
Laravel Version
10.29
Which operating systems does with happen with?
Linux
Notes
No response