A folder-based media library and picker field for Filament v4 and v5, built on top of Spatie Media Library.
- A full-page media manager (folders, search, sort, upload, tagging, PDF page-count preview) registered as a Filament page.
- A
MediaPickerform field (extendsModalTableSelect) for selecting media from within any Filament form/resource. - Folder tree organization on top of Spatie Media Library's
mediatable. - Automatic PDF thumbnail placeholder generation.
composer require immera/filament-media-libraryThis package builds on Spatie Media Library and Spatie Tags, neither of which run their migrations automatically. If your app doesn't already have media and tags/taggables tables, publish and run them:
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-migrations"
php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag="tags-migrations"
php artisan migrateRegister the plugin on your panel:
use Immera\FilamentMediaLibrary\FilamentMediaLibraryPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FilamentMediaLibraryPlugin::make(),
]);
}Publish Filament's assets so this package's compiled CSS is copied into your public/ directory:
php artisan filament:assetsNo Vite/Node setup is required for this — the package ships a precompiled, self-contained stylesheet and registers it with Filament directly. Re-run this command whenever you update the package. If your app's composer.json has a post-autoload-dump script calling @php artisan filament:upgrade (added by filament:install), this happens automatically on every composer update.
Optionally publish the default PDF thumbnail placeholder image to customize it:
php artisan vendor:publish --tag=filament-media-library-assetsuse Immera\FilamentMediaLibrary\Forms\Components\MediaPicker;
MediaPicker::make('featured_image')
->showFileName()
->downloadable()
->acceptedFileTypes(['image/*']);MIT