Have you verified that the image is passed in the request?
FilamentPHP + Spatie Media library plugin: Images are not being saved
Hey there,
I am using FilamentPHP and Spatie media library. Additionally, I am using the Spatie media library FilamentPHP plugin in order to show and upload the images in my admin panel.
However, the images are not being uploaded and stored at all!
This is my model:
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
class OrderItem extends Model implements HasMedia
{
use InteractsWithMedia;
public function registerMediaCollections(): void
{
$this->addMediaCollection('designs')
->useDisk('designFiles');
}
}
My filesystem.php:
'designFiles' => [
'driver' => 'local',
'root' => storage_path('app/public/designs'),
'url' => env('APP_URL') . '/storage/designs',
'visibility' => 'public',
],
My filament resource:
SpatieMediaLibraryFileUpload::make('design')
->collection('designs')
->downloadable()
->multiple(),
The image I upload on my filament resource are being stored temporarily at storage/app/livewire-tmp. However, there is no entry in my spatie media library media table and the image is also not being saved to the desired disk (designFiles).
I have already tried to debug this problem but there is no error event being logged at all. I am using Laravel Valet and I have also added the port to my APP_URL variable with my .env file as suggested here but it did not help me.
I have also run php artisan storage:link but because I did run this command before already, it did not change anything. The image is still not being saved.
Those are the versions I use:
"php": "^8.2",
"filament/filament": "^3.2",
"filament/spatie-laravel-media-library-plugin": "^3.2",
"laravel/framework": "^11.9",
"spatie/laravel-medialibrary": "^11.8"
Anybody has an idea how to fix this problem?
Kind regards
Please or to participate in this conversation.