SpatieMediaLibraryFileUpload not showing preview when set to multiple

"filament/filament": "4.0.7" "filament/spatie-laravel-media-library-plugin": "4.0.7" After upgrading from V3 to V4 the SpatieMediaLibraryFileUpload component doesn't show image preview for exisiting images. The images are save to the database, and attached to the model. This is verified on the Frontend and the TableView also shows the images The exact same component configuration works works in V3 Resource
SpatieMediaLibraryFileUpload::make(name: 'media')
->disk(name: 'products')
->collection(collection: 'products')
->multiple(),
SpatieMediaLibraryFileUpload::make(name: 'media')
->disk(name: 'products')
->collection(collection: 'products')
->multiple(),
Model
public function registerMediaCollections(): void
{
$this
->addMediaCollection(name: 'products')
->useDisk(diskName: 'products')
->useFallbackUrl(url: '/images/missing-product-image.jpg');
}

public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion(name: 'optimized')
->withResponsiveImages()
->width(width: 500)
->height(height: 500)
->optimize();
}
public function registerMediaCollections(): void
{
$this
->addMediaCollection(name: 'products')
->useDisk(diskName: 'products')
->useFallbackUrl(url: '/images/missing-product-image.jpg');
}

public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion(name: 'optimized')
->withResponsiveImages()
->width(width: 500)
->height(height: 500)
->optimize();
}
Things done:
php artisan filament:upgrade
php artisan cache:clear
php artisan view:clear
php artisan config:clear
npm run dev
php artisan filament:upgrade
php artisan cache:clear
php artisan view:clear
php artisan config:clear
npm run dev
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?