Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Modules Laravel Package

coolsam/modules

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Modularity Alignment: The package leverages nwidart/laravel-modules to provide a Filament-specific modular architecture, aligning with Laravel’s modular design patterns. This is ideal for large-scale applications requiring logical separation of concerns (e.g., feature teams, plugins, or domain-driven design).
  • Filament Integration: Designed as a wrapper for Filament 4.x/5.x, it extends Filament’s plugin system while maintaining compatibility with Laravel’s module ecosystem. The cluster-based organization (e.g., grouping resources/pages/widgets by module) reduces namespace collisions and improves maintainability.
  • Plugin System: Automates Filament plugin registration, reducing boilerplate for modular admin panels. The ModulesPlugin acts as a meta-plugin, dynamically loading all module plugins without manual registration.
  • Panel Support: Enables multi-panel architectures (e.g., a main admin panel with sub-panels per module), useful for tenant-specific or feature-isolated admin interfaces.

Integration Feasibility

  • Laravel 11/12 + Filament 4.x/5.x: Tightly coupled to these stacks, ensuring minimal friction for greenfield projects. For legacy systems, version compatibility (e.g., Filament 3.x) requires downgrading the package.
  • Dependency Management: Automatically installs nwidart/laravel-modules (v11/12), reducing setup complexity. However, manual configuration (e.g., composer.json merge-plugin) is required for autoloading.
  • Filament-Specific Features: Supports resource, page, widget, panel, and cluster generation via Artisan commands, accelerating development. The access control WIP (e.g., CanAccessTrait) suggests future-proofing for RBAC.
  • Cluster vs. Flat Structure: Offers flexibility to organize Filament assets either in module-specific clusters (recommended for large apps) or globally (simpler but less isolated).

Technical Risk

  • Version Lock: Hard dependency on Filament 4.x/5.x and Laravel 11/12 may limit adoption in older ecosystems. Filament 5.x support is experimental (v5.1.0), adding risk for early adopters.
  • Complexity Overhead: Modular Filament introduces additional layers (e.g., clusters, panels, plugins), which may increase cognitive load for teams unfamiliar with Laravel Modules.
  • Autoloading Pitfalls: Misconfigured composer.json (e.g., missing merge-plugin) can break module discovery. Requires careful setup.
  • Performance Impact: Dynamic plugin loading (via ModulesPlugin) adds runtime overhead for module discovery. Benchmarking may be needed for large module counts.
  • Access Control Gaps: Current RBAC features are work-in-progress (WIP), limiting immediate use for security-critical applications.

Key Questions

  1. Use Case Fit:
    • Is the project large enough to justify modular Filament (vs. monolithic)? Target >50 Filament resources/pages.
    • Are there multiple teams or feature isolation needs (e.g., plugins, tenants)?
  2. Stack Compatibility:
    • Can the team upgrade to Laravel 11/12 + Filament 4.x/5.x? If not, downgrade paths must be explored.
  3. Development Workflow:
    • How will module dependencies (e.g., shared widgets between modules) be managed?
    • Is the team comfortable with cluster-based navigation (UX tradeoff vs. global resources)?
  4. Long-Term Maintenance:
    • What’s the strategy for module updates (e.g., breaking changes in Filament 5.x)?
    • Are there CI/CD pipelines to handle module-specific testing/deployment?
  5. Security:
    • Will the WIP access control suffice, or is a custom solution needed?
    • How will module isolation be enforced (e.g., database schemas, API endpoints)?

Integration Approach

Stack Fit

  • Primary Use Case: Large-scale Filament applications requiring:
    • Plugin-like modularity (e.g., feature teams, SaaS multi-tenancy).
    • Logical separation of admin panel components (resources, pages, widgets).
    • Multi-panel architectures (e.g., main admin + module-specific panels).
  • Anti-Patterns: Avoid for small projects (<20 Filament resources) or teams unfamiliar with Laravel Modules.
  • Complementary Tools:
    • Laravel Modules: For broader app modularity (e.g., API routes, models).
    • Filament Plugins: For reusable UI components (e.g., shared dashboards).
    • Spatie Laravel-Permission: For advanced RBAC (until access control matures).

Migration Path

Scenario Approach
Greenfield Project 1. Install Laravel 11/12 + Filament 4.x. 2. Add coolsam/modules. 3. Run php artisan modules:install. 4. Generate modules/clusters via Artisan.
Existing Monolithic Filament 1. Refactor incrementally: Migrate one resource/page at a time into a module. 2. Use module:filament:install to scaffold clusters. 3. Update navigation to use clusters. 4. Deprecate global Filament files.
Legacy Filament 3.x Downgrade to filament-modules:4.x and Laravel 10, but lose Filament 4.x/5.x features.
Hybrid Monolithic + Modular Use config/filament-modules.php to set mode: BOTH for gradual adoption.

Compatibility

  • Filament 4.x/5.x: Full support. Filament 5.x is experimental (test thoroughly).
  • Laravel 11/12: Required. Laravel 10 supported via v4.x.
  • PHP 8.2+: Mandatory (due to Filament 4.x/5.x).
  • Database: No direct impact, but module-specific migrations may need isolation.
  • Third-Party Plugins: Most Filament plugins should work, but module-aware plugins (e.g., those using ModulesPlugin) may conflict.

Sequencing

  1. Prerequisites:
    • Upgrade Laravel/Filament to supported versions.
    • Configure composer.json merge-plugin for module autoloading.
  2. Core Setup:
    • Install coolsam/modules and publish config.
    • Register ModulesPlugin in AdminPanelProvider.
  3. Modularization:
    • Create modules via php artisan module:make.
    • Install Filament in modules: php artisan module:filament:install.
    • Generate clusters/resources/pages: php artisan module:filament:resource.
  4. Navigation:
    • Configure clusters.enabled and panels.group in filament-modules.php.
    • Test cluster navigation UX.
  5. Access Control:
    • Replace Filament\Resources\Resource with Coolsam\Modules\Resource for protected routes (WIP).
  6. CI/CD:
    • Add module-specific testing (e.g., php artisan module:test).
    • Configure deployment pipelines for module updates.

Operational Impact

Maintenance

  • Pros:
    • Isolated Updates: Modules can be updated independently (e.g., fix a bug in InventoryModule without touching UsersModule).
    • Team Ownership: Clear boundaries for feature teams (e.g., "Payments team owns the PaymentsModule").
    • Reduced Merge Conflicts: Changes to one module’s Filament resources won’t affect others.
  • Cons:
    • Additional Layers: Debugging requires navigating module → cluster → Filament component.
    • Tooling Overhead: Artisan commands for module-specific operations (e.g., module:filament:resource).
    • Configuration Drift: filament-modules.php settings must be consistent across environments.

Support

  • Troubleshooting:
    • Module Discovery: Verify composer dump-autoload and merge-plugin are configured.
    • Plugin Registration: Check ModulesPlugin is registered in AdminPanelProvider.
    • Cluster Navigation: Ensure clusters.enabled = true and UX preferences (e.g., use-top-navigation).
  • Common Issues:
    • Autoloading Failures: Missing Modules/*/composer.json in merge-plugin.
    • Route Conflicts: Global Filament resources clashing with module clusters.
    • Panel Isolation: Module panels not appearing in navigation (check panels.group config).
  • Documentation Gaps:
    • Access Control: WIP features lack examples.
    • Multi-Environment: No guidance on module-specific .env or config.

Scaling

  • Performance:
    • Module Discovery: ModulesPlugin loads all modules on panel initialization. For **>5
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony