majid-shafik / filament-media-library
An advanced, secure, and modern centralized Media Library plugin for Filament 5 with SHA-256 deduplication, hierarchical category tree, usage tracking, and native RTL support.
Package info
github.com/Majid-Shafik/filament-media-library
pkg:composer/majid-shafik/filament-media-library
Requires
- php: ^8.2
- filament/filament: ^5.0
- spatie/laravel-package-tools: ^1.15
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.7|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
An advanced, secure, and modern centralized Media Library Plugin for Filament 5 featuring:
- 🚀 SHA-256 Deduplication: Automatic byte-level fingerprinting to prevent uploading duplicates and save disk storage.
- 🌳 Hierarchical Categories Tree: Interactive folder organization with cyclic recursion protection.
- 🛡️ Deep Security Sanitization: Magic byte signatures, GD re-encoding to strip malicious EXIF/payloads, and decompression bomb protection.
- 🔗 Smart Usages Tracking: Prevent breaking links by tracking where media is used across content, sections, and page builder blocks.
- ⚡ Native RTL & Arabic Support: Built from the ground up for modern enterprise workflows with full RTL ergonomics.
📸 Screenshots & Showcase
1. Centralized Media Library & Upload Management (مكتبة الوسائط ورفع الملفات)
Full interactive asset browser with live grid previews, folder filtering, instant secure upload, favorite toggle, and comprehensive usage tracking:
2. Hierarchical Categories Tree (إدارة شجرة التصنيفات الهرمية)
Organize and structure media assets into flexible multi-level categories with cyclic recursion protection and quick action controls:
📦 Installation
You can install the package via composer:
composer require majid-shafik/filament-media-library
Publish and run the migrations:
php artisan vendor:publish --tag=filament-media-library-migrations php artisan migrate
Optionally publish the config file:
php artisan vendor:publish --tag=filament-media-library-config
🚀 Registering with Filament Panel
Register the plugin in your AdminPanelProvider:
use MajidShafik\FilamentMediaLibrary\FilamentMediaLibraryPlugin; use Filament\Panel; public function panel(Panel $panel): Panel { return $panel // ... ->plugins([ FilamentMediaLibraryPlugin::make(), ]); }
🎨 Form Component Usage
Use MediaImagePicker directly inside any Filament Form, Infolist, or PageBuilder Block:
use MajidShafik\FilamentMediaLibrary\Components\MediaImagePicker; MediaImagePicker::make( imagePathField: 'image', mediaIdField: 'image_media_id', label: 'الصورة البارزة', directory: 'uploads/contents', required: true, )
🛠️ Console Commands
To calculate SHA-256 fingerprints for legacy media:
php artisan media:backfill-hashes --all
📄 License
The MIT License (MIT). Please see License File for more information.


