nwidart/laravel-modules to integrate Filament into a modular Laravel architecture, aligning perfectly with domain-driven design (DDD) or feature-based modularity. This is ideal for large-scale applications where isolation, reusability, and independent deployability are priorities.UsersPanel, InventoryPanel). This is a game-changer for complex applications with distinct admin workflows.app/Providers/Filament/AdminPanelProvider.php). Minimal friction for new projects.nwidart/laravel-modules (v11/12), adding ~50KB to vendor/ but enabling module autoloading and namespace isolation.| Risk Area | Assessment | Mitigation Strategy |
|---|---|---|
| Module Autoloading | Requires merge-plugin in composer.json. Misconfiguration can break PSR-4. |
Test autoloading early; use composer dump-autoload post-install. |
| Filament Version Lock | Hard dependency on Filament 4.x (v5.x). Upgrades may break compatibility. | Monitor Filament 5.x support (experimental in v5.1.0); plan for fork if needed. |
| Cluster vs. Plugin | Clusters introduce new navigation patterns (top/side nav). UX may differ from native Filament. | Pilot with a single module; gather feedback before full adoption. |
| Panel Isolation | Independent panels require separate auth/gate policies. May complicate RBAC. | Design a centralized auth layer (e.g., CanAccessTrait) for module-specific permissions. |
| Performance | Module discovery and plugin registration add runtime overhead. | Benchmark with 10+ modules; optimize config/filament-modules.php caching. |
| Migration Path | Existing Filament plugins/resources must be refactored into modules. | Use module:filament:install incrementally; avoid big-bang migration. |
Modularity Strategy:
UsersModule, PaymentsModule) or technical modules (e.g., AuthModule, LoggingModule)?Filament Plugin vs. Module:
Authentication/Authorization:
can_access_inventory_panel) be implemented?CanAccessTrait, policy classes, or Filament’s native gates.Deployment Strategy:
composer.json merge-plugin and CI/CD pipelines.Legacy Integration:
module:filament:install for new modules; manually refactor old ones.Testing Scope:
php artisan module:test UsersModule)?ModuleTestCase or custom test suites.Performance Baseline:
ModulesPlugin caching.bootstrap/app.php).merge-plugin for module autoloading. Conflicts unlikely if configured early.nwidart/laravel-modules).| Phase | Action | Tools/Commands |
|---|---|---|
| Assessment | Audit existing Filament resources/plugins for modularization potential. | Manual review; php artisan filament:list |
| Setup | Install coolsam/modules and nwidart/laravel-modules. Configure composer.json. |
composer require coolsam/modules + merge-plugin |
| Configuration | Publish config (filament-modules.php) and set mode (PLUGINS/PANELS/BOTH). |
php artisan vendor:publish --tag="modules-config" |
| Pilot Module | Create a test module (e.g., SettingsModule) and install Filament support. |
php artisan module:make SettingsModule + php artisan module:filament:install |
| Refactor | Migrate 1–2 Filament resources/pages into the pilot module. | Manual refactoring or module:make:filament-resource |
| Register Plugin | Add ModulesPlugin to AdminPanelProvider. |
->plugin(ModulesPlugin::make()) |
| Scale | Repeat for remaining modules; monitor performance. | Incremental adoption; benchmark with laravel-debugbar |
auto-register-plugins is false.MyModulePanelServiceProvider). Override AppServiceProvider if needed.module-path() helper for assets.auth middleware applies to all panels/clusters. Module-specific auth requires custom gates.ResourceCreated) are module-agnostic. Use module() helper to scope listeners.nwidart/laravel-modules first).coolsam/modules + configure composer.json.mode (e.g., PLUGINS).module:filament:install).module:make:filament-resource).ModulesPlugin in AdminPanelProvider.clusters.enabled/use-top-navigation based on UX feedback.InventoryModule").How can I help you explore Laravel packages today?