alizharb/laravel-modular-filament
Laravel Modular Filament 🚀
Laravel Modular Filament is the official bridge for Laravel Modular. It enables automatic discovery, registration, and first-class Artisan support for Filament resources, pages, widgets, and clusters within your modular architecture.
✨ Features
- 🔍 Automatic Discovery: Automatically scans and registers Filament Resources, Pages, Widgets, and Clusters in
Modules/*/app/Filament. - 🏗️ Modular Artisan Commands: Enhanced Filament commands (e.g.,
make:filament-resource) with--modulesupport. - 🎨 Cluster Support: Full support for creating and discovering Filament Clusters within modules.
- 📄 Native Stubs: Uses Filament's native stubs for consistent code generation without version drift.
- 🩺 Diagnostics Ready: Designed for Laravel Modular 1.2
modular:doctor,modular:status, andmodular:debug. - 🤖 Laravel Boost Support: Ships Boost guidance for module-owned Filament artifacts.
- ✅ Strictly Typed: Fully compatible with PHPStan level 5 (and scalable).
🚀 Installation
Install the package via Composer (requires alizharb/laravel-modular):
composer require alizharb/laravel-modular-filament
The service provider will be automatically registered. It will automatically hook into the laravel-modular registry.
📖 Usage
Generating Modular Components
Use the provided modular commands with the --module flag to generate Filament components directly into your modules.
1. Resources
Create a new Resource in a module.
php artisan make:filament-resource Post --module=Blog
- Creates:
Modules/Blog/app/Filament/Resources/Posts/PostResource.php - View:
Modules/Blog/resources/views/filament/resources/posts/post-resource/pages/...(if generated)
2. Pages
Create a new standalone Page in a module.
php artisan make:filament-page Dashboard --module=Shop
- Class:
Modules/Shop/app/Filament/Pages/Dashboard.php - View:
Modules/Shop/resources/views/filament/pages/dashboard.blade.php
3. Widgets
Create a new Widget in a module.
php artisan make:filament-widget StatsOverview --module=Analytics
- Class:
Modules/Analytics/app/Filament/Widgets/StatsOverview.php - View:
Modules/Analytics/resources/views/filament/widgets/stats-overview.blade.php
4. Clusters
Create a new Cluster in a module to group resources and pages.
php artisan make:filament-cluster Settings --module=System
- Class:
Modules/System/app/Filament/Clusters/Settings/SettingsCluster.php
Other Commands
Most Filament generation commands are supported with the --module flag:
make:filament-relation-managermake:filament-thememake:filament-tablemake:filament-formmake:filament-infolist
⚙️ Configuration
The bridge respects your existing modular.php paths and Filament's own configuration. No additional configuration is required.
Diagnostics
After changing module Filament paths or manifests, run:
php artisan modular:doctor
php artisan modular:check
php artisan modular:debug Shop --json
Add manifest capabilities such as filament.resources, filament.pages, and filament.widgets to provides when a module exposes Filament surfaces.
🧪 Testing
vendor/bin/pest
🤝 Contributing
Please see CONTRIBUTING for details.
📄 License
The MIT License (MIT). Please see License File for more information.
Related Packages
The ultimate Filament module manager for Laravel Modular. Seamlessly search, ins...
The official JavaScript bridge for Laravel Modular offering automatic discovery...
The official Livewire bridge for Laravel Modular offering automatic discovery an...
A Laravel package for modular architecture with Filament v4 support, pattern inf...
Laravel package that auto-discovers and registers module assets (configs, routes...