© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
1 reply
shamarkellman

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
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SpatieMediaLibraryFileUpload not showing
FilamentFFilament / ❓┊help
3y ago
BUG: ->multiple() in SpatieMediaLibraryFileUpload not working
FilamentFFilament / ❓┊help
3y ago
Showing icon preview
FilamentFFilament / ❓┊help
3y ago
SpatieMediaLibraryFileUpload::make('x')->label(__("x"))->multiple()
FilamentFFilament / ❓┊help
2y ago