nwidart/laravel-modules to decompose Filament admin panels into discrete, self-contained modules (e.g., Users, Products, Reports). This aligns well with Domain-Driven Design (DDD) and microservice-like isolation within a monolith, reducing coupling between admin features.FilamentPanel, Resource classes).app:providers, bootstrap/app.php changes).nwidart/laravel-modules (v11+) for module scaffolding.nwidart/laravel-modules may require updates if that package evolves significantly.bootModule()).ModuleMiddleware).resources/views/modules/module.blade.php).| Risk Area | Severity | Mitigation |
|---|---|---|
| Filament Version Lock | Medium | Package is tied to Filament 4.x; upgrades to Filament 5.x may require rework. |
| Module Isolation Gaps | Low | Shared services (e.g., Auth, Database) must be explicitly configured per module. |
| Performance Overhead | Low | Module auto-loading adds minimal overhead; caching (config('modules.cache')) mitigates this. |
| Testing Complexity | Medium | Modules introduce nested service providers; require module-specific test suites. |
| Migration Path | High | Large Filament apps may need phased migration (e.g., start with non-critical modules). |
Inventory, CRM) or technical layers (e.g., Auth, Reports)?Cache, Queue) or database connections without tight coupling?ModuleServiceProvider::boot() to bind shared services per module.Panel configuration required.)spatie/laravel-permission) must be scoped to specific modules.Dashboard).Auth, Notifications) that may need module-aware refactoring.Settings) into a module.config/modules.php)./modules/settings/resources).auth:admin per module).Users, Products).Logs, API Keys).Stripe, Mailchimp).FilamentPanel with ModulePanel in app/Providers/FilamentServiceProvider.php.routes/web.php to use module-aware routes (if custom).| Component | Compatibility | Notes |
|---|---|---|
| Filament Resources | ✅ Full support (convert to modules). | Use php artisan module:make command. |
| Filament Panels | ✅ Supported via ModulePanel. |
Extends FilamentPanel with module awareness. |
| Laravel Modules | ✅ Core dependency (nwidart/laravel-modules). |
Follows its conventions (e.g., Modules/Users/Resources/ structure). |
| Third-Party Packages | ⚠️ Varies (e.g., spatie/laravel-permission works but may need module scoping). |
Test with critical packages pre-migration. |
| Custom Filament Plugins | ❌ May require updates. | Plugins using Resource hooks may need module-aware overrides. |
composer require coolsam/filament-modules nwidart/laravel-modules
php artisan vendor:publish --provider="Coolsam\Modules\ModulesServiceProvider"
config/modules.php.php artisan module:make Users --resource --panel
Modules/Users/Module.php (e.g., middleware, routes).modules.log).Products module without touching Users).UsersModule, ReportsModule).[UsersModule] Error: ...).ModuleServiceProvider.php artisan module:list to manage modules.php artisan module:check).php artisan module:install Users
php artisan module:uninstall Reports
Modules/Users/Database/Migrations/ for module-specific DB issues.dd(app()->make('module')); to inspect module container bindings.Module class for custom logic (e.g., app/Modules/CustomModule.php).| Issue Type | Resolution Path |
|---|---|
| Module not loading | Check config/modules.php and app/Providers/ModulesServiceProvider.php. |
| Fil |
How can I help you explore Laravel packages today?