Download the PHP package tomatophp/filament-media-manager without Composer
On this page you can find all versions of the php package tomatophp/filament-media-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package filament-media-manager

Filament media manager
Manage your media files using spatie media library with easy to use GUI for FilamentPHP
Installation
now you need to publish media migration
after installing your package, please run this command
finally, register the plugin on /app/Providers/Filament/AdminPanelProvider.php, if you like to use GUI and Folder Browser.
Features
- 📁 Manage your media files using spatie media library
- 📂 Create folders and subfolders
- 🔒 Set password for folders with secure access
- 📝 Upload Files with Custom Fields using
->schema() - 🤖 Auto Create Folders for Model/Collection/Record
- 🌍 RTL/Multi Language Support
- 🎨 Full Dark Mode Support
- 🖼️ MediaManagerPicker - Browse and select media from folder structure
- ⚡ MediaManagerInput - Direct file upload with Spatie Media Library
- 🔧 InteractsWithMediaManager Trait - Easy model integration
- 📊 Live Preview with thumbnails and file information
- ✅ Selection validation (min/max items)
- 🔄 Auto-save and modal management
- 🏷️ Collection Names - Multiple pickers on same page with separate collections
- 📱 Responsive Images - Automatic responsive image generation with Spatie
- 🎯 Drag & Drop Reordering - Visual reordering of selected media
Screenshots

Usage
you can use the media manager by adding this code to your filament component
or you can use Media Library Picker like this
and on your model to manage your attached media
MediaManagerPicker Features
- Multiple/Single Selection: Use
->multiple()or->single()to control selection mode - Item Limits: Set
->maxItems(n)and->minItems(n)to enforce selection constraints - Collection Names: Use
->collection('name')to separate media for different pickers on the same page - Responsive Images: Use
->responsiveImages()to automatically generate responsive images with Spatie - Drag & Drop Reordering: Visually reorder selected media items with drag handles
- Password Protected Folders: Browse secure folders with password verification
- Live Preview: See selected items with preview thumbnails, file info, and remove buttons
- Dark Mode Support: Fully styled for both light and dark themes
- Auto-close Modal: Modal automatically closes after selection with success notification
Multiple Pickers with Collections
You can use multiple MediaManagerPicker components on the same page by using collection names:
Each picker maintains its own separate media attachments based on the collection name.
Working with Media in Models
InteractsWithMediaManager Trait
Use the InteractsWithMediaManager trait in your models to easily access and manage media attached via MediaManagerPicker:
Available Methods
Usage Examples
For complete documentation of the trait, see TRAITS.md.
Important: Run Migrations
After installing or updating the package, make sure to run migrations to add the required database columns:
This will add the following columns to the media_has_models table:
order_column- For drag & drop reordering functionalitycollection_name- For multiple pickers with separate collectionsresponsive_images- For responsive images support
Add Custom Preview to selected type on the media manager
you can add custom preview to selected type on the media manager by add this code to your provider
in your view file you can use it like this
you can attach global js or css file to the media manager by add this code to your provider
please note that the name of the component will be the same name of the collection.
Allow Sub Folders
you can allow create and manage subfolders on your media manager on /app/Providers/Filament/AdminPanelProvider.php
Allow User Access
now you can allow user to access selected folder and restract user to access each other folders if the folder is not public on /app/Providers/Filament/AdminPanelProvider.php
now on your user model you can use this trait to allow user to access selected folder
NOTE don't forget to migrate after update the plugin
Folders API
now you can access your media and folders using API you have 2 endpoints
/api/foldersto get all folders/api/folders/{id}to get folder by id with sub folders and media files
to allow this feature, you need to publish the config file by use this command
then you can set api.active to true on the config file
Publish Assets
you can publish config file by use this command
you can publish a view file by using this command
you can publish a language file by using this command
you can publish the migrations file by using this command
Testing
This package includes comprehensive test suites for all major features. Tests are written using Pest PHP.
Running Tests
Run all tests:
Run a specific test file:
Run with coverage:
Test Coverage
The test suite includes:
- MediaManagerPickerTest - Tests for MediaManagerPicker component, folder navigation, password protection, selection validation, and file upload
- MediaManagerInputTest - Tests for MediaManagerInput component, file upload, media retrieval, deletion, and custom schema
- InteractsWithMediaManagerTest - Tests for the trait methods including attach, detach, sync, and URL generation
For detailed testing documentation, see tests/README.md
Code Style
if you like to fix the code style, just use this command
PHPStan
if you like to check the code by PHPStan just use this command
Other Filament Packages
Check out our Awesome TomatoPHP
All versions of filament-media-manager with dependencies
tomatophp/console-helpers Version ^1.1
spatie/laravel-medialibrary Version ^10.0|^11.15
tomatophp/filament-icons Version ^v4.0
filament/spatie-laravel-media-library-plugin Version ^v4.0
filament/filament Version ^v4.0