Download the PHP package georgemosesgroup/filament-media-library without Composer
On this page you can find all versions of the php package georgemosesgroup/filament-media-library. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download georgemosesgroup/filament-media-library
More information about georgemosesgroup/filament-media-library
Files in georgemosesgroup/filament-media-library
Package filament-media-library
Short Description A powerful media library package for Filament v3/v4/v5+ with MediaPicker form component, drag & drop uploads, folder management, and built-in responsive thumbnail generation
License MIT
Homepage https://github.com/georgemosesgroup/FilamentMediaLibrary
Informations about the package filament-media-library
Filament Media Library
A powerful media library package for Filament with MediaPicker form component, drag & drop uploads, and full integration with FileManager.
Requirements
| Package | Version |
|---|---|
| PHP | 8.1+ |
| Laravel | 10.x, 11.x, 12.x |
| Filament | 3.x, 4.x, 5.x |
Features
- Media Library Page - Full standalone file manager in navigation
- MediaPicker Form Component - Select files from library or upload new ones
- Two Modes - Browse-only (default) or Upload mode
- Browse Library Modal - Full file browser with folder navigation
- Single & Multiple Selection - Support for cover images and galleries
- Gallery Grid Layout - Unified container with customizable columns and height
- Interactive Media Players - Built-in video and audio players in grid mode
- Auto Directory Structure - Automatically creates folder hierarchy based on resource name
- Multi-tenancy Support - Full tenant isolation out of the box
- Filament Plugin - Easy registration with customizable navigation
Installation
Quick Install (Recommended)
Run the install command to automatically configure everything:
This will:
- Publish the config file
- Run migrations
- Configure storage (DO Spaces/S3 if selected)
- Configure your Filament theme CSS for Tailwind
Then rebuild your theme:
Manual Installation
1. Register Plugin
Add the plugin to your Filament panel in AdminPanelProvider.php:
This automatically adds the Media Library page to your navigation.
2. Publish Config (Optional)
3. Run Migrations
4. Publish Assets
The package includes its own CSS for hover effects and animations. Publish the assets:
Note: This step is required after installation or updating the package. The CSS is automatically registered with Filament's asset system.
5. Configure Custom Theme (Optional - for Media Library Page)
If you're using the Media Library page (not just MediaPicker), add the package views to your Filament theme CSS (resources/css/filament/admin/theme.css):
Then rebuild your theme:
Plugin Options
Customize the Media Library page:
Disable the page (use only MediaPicker component):
Configuration
Config file: config/filament-media-library.php
Key Settings
Cloud Storage (S3 / DigitalOcean Spaces)
The package fully supports S3-compatible cloud storage including AWS S3 and DigitalOcean Spaces.
1. Configure Filesystem Disk
Add to config/filesystems.php:
2. Environment Variables
For DigitalOcean Spaces:
For AWS S3:
3. Set Media Library Disk
Update your .env:
Features
- Automatic thumbnail generation - Works seamlessly with cloud storage
- Public URLs - Files are publicly accessible via CDN
- Visibility control - Set 'public' or 'private' visibility per file
- Temporary URLs - Private files use signed temporary URLs (S3 feature)
Usage
Basic Usage (Browse Mode - Default)
By default, MediaPicker shows a "Browse Library" button to select from existing files:
Upload Mode
Enable drag & drop upload with allowUpload():
Model Setup
Minimum required:
Migration:
Auto Directory Structure
Automatically organize uploads into folders based on resource:
Available placeholders:
| Placeholder | Description | Example |
|---|---|---|
{resource} |
Resource name | Products |
{record_id} |
Record ID | 123 |
{field} |
Field name | cover_image_id |
{date} |
Current date | 2026-01-28 |
{year} |
Current year | 2026 |
{month} |
Current month | 01 |
{tenant_id} |
Tenant ID | 1 |
Example folder structure:
Component Options
File Type Filters
Selection Mode
Modal Customization
Upload Settings
Visibility & State
Gallery Layout (Grid Mode)
Display multiple files in a customizable grid layout:
Grid Mode Features:
- Unified container with files and "Add" button together
- Drag & drop directly onto the grid area with prominent overlay
- Interactive video player with play/pause
- Interactive audio player with purple gradient background
- Hover effects on cards with ring highlight
- Remove button appears on hover (red on hover)
- Smooth animations and transitions
Interactive Media Players
In grid mode, media files have built-in players:
Video:
- Click play button to start video
- Native controls appear (play, pause, progress, volume, fullscreen)
- Thumbnail shown when paused
Audio:
- Purple gradient background
- Click to play/pause
- Shows filename
How It Works
Two Modes
-
Browse Mode (default) - Click "Browse Library" button
- Opens modal with full file browser
- Navigate folders, search files
- Select existing files from library
- Upload Mode - Enable with
->allowUpload()- Shows drag & drop zone
- Files upload immediately
- Stored in configured directory
- ID saved to form field
Data Storage
Single file: Stores integer ID
Multiple files: Stores JSON array of IDs
Optional: Helper Methods
Add these to your model for convenient access:
API Usage (Frontend)
Get file data for API responses:
Multi-tenancy
The package automatically handles tenant isolation:
- All files are scoped to current tenant
- Folder structure is tenant-specific
- Users can only see their tenant's files
Tenant is resolved from (in order):
- Container-bound
tenant - Filament
Filament::getTenant() - Authenticated user's
tenant_id - Session
filament_tenant_id
Synchronization with FileManager
This package uses the same database tables as FileManager:
file_folders- Folder structurefile_items- File recordsfile_tags- File tagsfile_versions- File versionsfile_shares- Shared links
Files uploaded via MediaPicker appear in FileManager and vice versa.
Artisan Commands
Install Command
Migrate Storage Command
Migrate files between storage disks (e.g., local to cloud):
Thumbnails
The package generates two layers of thumbnails out of the box:
-
Admin preview — a single 300×300 thumbnail stored in the
thumbnail_pathcolumn onmedia_itemsand used in the Filament admin grid. Generated synchronously on upload. - Responsive thumbnails — a configurable set of widths stored under
{thumbs_path}/{media_id}/{size}/{filename}.{format}. Generated asynchronously byGenerateThumbnailsJob, intended for the front-end. Driver is selected automatically (Imagick → GD → noop).
Configuration
API on MediaItem
getThumbnailUrl() (legacy admin preview) and the thumbnail_path column continue to work as before.
Driver Selection
| Driver | When used |
|---|---|
| imagick | extension_loaded('imagick') and format supported |
| gd | imagick missing, gd available |
| noop | both missing — logs a warning, returns no thumbs |
Sizes larger than the source width are skipped automatically. SVG and non-image items are also skipped.
Regenerating Thumbnails
Migration from Custom Observer
If your application previously implemented its own ThumbnailGenerator + MediaItemObserver to produce responsive thumbs, you can drop them after upgrading to v1.3 — the package now handles this end to end. Update consumer code that reads paths to use $item->thumbUrl($size) instead of building paths by hand.
Updating the Package
After updating via composer, run:
UI/UX Features
Drag & Drop Upload
When allowUpload() is enabled:
- Clear "Drop to upload" overlay when dragging files
- Backdrop blur effect for better visibility
- Prominent border highlight
Card Hover Effects
- Ring highlight on card hover
- Remove button hidden by default, appears on hover
- Remove button turns red when hovered
- Subtle overlay on image cards
Upload Progress
- Animated progress bar with glow effect
- Shimmer animation during upload
- Success checkmark with green glow
- Error state with retry button
Responsive Design
All components are fully responsive and work on mobile devices.
Troubleshooting
Upload returns 500 error
Check Laravel log for details:
Common issues:
- tenant_id NULL - User not authenticated or tenant not resolved
- Permission denied - Check storage folder permissions
- File too large - Increase
upload_max_filesizein php.ini
Files not showing
- Clear cache:
php artisan cache:clear - Check tenant scope is correct
- Verify files exist in database
Modal not opening
- Check browser console for JS errors
- Ensure Alpine.js is loaded
- Clear Filament cache:
php artisan filament:cache-components
License
MIT License - see LICENSE file for details.
All versions of filament-media-library with dependencies
filament/filament Version ^3.0|^4.0|^5.0
illuminate/contracts Version ^10.0|^11.0|^12.0
league/flysystem-aws-s3-v3 Version ^3.0
spatie/laravel-package-tools Version ^1.14