immera/filament-media-library

A folder-based media library and picker field for Filament v4/v5, built on Spatie Media Library.

Maintainers

Package info

github.com/immera/filament-media-library

pkg:composer/immera/filament-media-library

Transparency log

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0 2026-07-28 14:09 UTC
No longer found in upstream repository

This package is auto-updated.

Last update: 2026-07-28 14:47:56 UTC


README

A folder-based media library and picker field for Filament v4 and v5, built on top of Spatie Media Library.

Features

  • A full-page media manager (folders, search, sort, upload, tagging, PDF page-count preview) registered as a Filament page.
  • A MediaPicker form field (extends ModalTableSelect) for selecting media from within any Filament form/resource.
  • Folder tree organization on top of Spatie Media Library's media table.
  • Automatic PDF thumbnail placeholder generation.

Installation

composer require immera/filament-media-library

This 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 migrate

Register 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:assets

No 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-assets

Usage

use Immera\FilamentMediaLibrary\Forms\Components\MediaPicker;

MediaPicker::make('featured_image')
    ->showFileName()
    ->downloadable()
    ->acceptedFileTypes(['image/*']);

License

MIT