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 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.
  • Filament Integration: Extends Filament’s plugin system to support module-scoped resources, pages, widgets, and panels, enabling granular admin panel segmentation. This reduces monolithic Filament configurations and improves maintainability.
  • Cluster-Based Organization: Introduces clusters (grouped Filament components per module), which can replace or complement Filament’s native plugin system. This is particularly useful for multi-tenant SaaS or microservice-like admin panels.
  • Panel Isolation: Supports independent Filament panels per module, allowing modules to have their own admin dashboards (e.g., UsersPanel, InventoryPanel). This is a game-changer for complex applications with distinct admin workflows.

Integration Feasibility

  • Laravel 11/12 + Filament 4.x: Tightly coupled with modern Laravel stacks, ensuring compatibility with Laravel’s new app structure (e.g., app/Providers/Filament/AdminPanelProvider.php). Minimal friction for new projects.
  • Backward Compatibility: Supports Laravel 10 + Filament 3.x via separate branches, but v5.x is future-focused (Laravel 11/12). Migration path exists but may require refactoring.
  • Dependency Overhead: Automatically installs nwidart/laravel-modules (v11/12), adding ~50KB to vendor/ but enabling module autoloading and namespace isolation.
  • Filament Plugin System: Works alongside Filament’s native plugins but abstracts module-specific Filament components into standalone units. No forced architecture—can opt into clusters, panels, or plugins.

Technical Risk

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.

Key Questions

  1. Modularity Strategy:

    • Are we adopting feature modules (e.g., UsersModule, PaymentsModule) or technical modules (e.g., AuthModule, LoggingModule)?
    • Impact: Affects cluster/panel design and isolation granularity.
  2. Filament Plugin vs. Module:

    • Should module-specific Filament components be plugins (registered globally) or clusters (isolated per module)?
    • Tradeoff: Plugins offer centralization; clusters enable independence.
  3. Authentication/Authorization:

    • How will module-specific permissions (e.g., can_access_inventory_panel) be implemented?
    • Options: CanAccessTrait, policy classes, or Filament’s native gates.
  4. Deployment Strategy:

    • Will modules be deployed independently (e.g., via module hot-reloading) or as a monolith?
    • Impact: Affects composer.json merge-plugin and CI/CD pipelines.
  5. Legacy Integration:

    • How will existing Filament resources/pages be migrated into modules?
    • Approach: Use module:filament:install for new modules; manually refactor old ones.
  6. Testing Scope:

    • Should module-specific Filament tests be isolated (e.g., php artisan module:test UsersModule)?
    • Tools: Leverage Laravel’s ModuleTestCase or custom test suites.
  7. Performance Baseline:

    • What is the acceptable latency for module discovery/plugin registration?
    • Benchmark: Test with 50+ modules; optimize ModulesPlugin caching.

Integration Approach

Stack Fit

  • Laravel 11/12: Native support; leverages new app scaffolding (e.g., bootstrap/app.php).
  • Filament 4.x: Primary target; Filament 5.x is experimental but promising.
  • PHP 8.2+: Enables enums (ConfigMode), attributes, and readonly properties used in the package.
  • Composer: Requires merge-plugin for module autoloading. Conflicts unlikely if configured early.
  • Database: No direct dependency, but modules may introduce schema migrations (handled via nwidart/laravel-modules).

Migration Path

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

Compatibility

  • Filament Plugins: Existing plugins will not auto-migrate but can coexist if auto-register-plugins is false.
  • Service Providers: Modules generate Filament-specific providers (e.g., MyModulePanelServiceProvider). Override AppServiceProvider if needed.
  • Views/Blade: Module-scoped Filament views are isolated. Use module-path() helper for assets.
  • Middleware: Filament’s auth middleware applies to all panels/clusters. Module-specific auth requires custom gates.
  • Events: Filament events (e.g., ResourceCreated) are module-agnostic. Use module() helper to scope listeners.

Sequencing

  1. Pre-requisites:
    • Laravel 11/12 project with Filament 4.x installed.
    • Basic module structure (or install nwidart/laravel-modules first).
  2. Core Setup:
    • Install coolsam/modules + configure composer.json.
    • Publish config and set mode (e.g., PLUGINS).
  3. Pilot Phase:
    • Create 1–2 modules with Filament support (module:filament:install).
    • Test resource/page generation (module:make:filament-resource).
  4. Integration:
    • Register ModulesPlugin in AdminPanelProvider.
    • Verify navigation (clusters/panels) and permissions.
  5. Optimization:
    • Benchmark module discovery time.
    • Adjust clusters.enabled/use-top-navigation based on UX feedback.
  6. Rollout:
    • Migrate remaining Filament components to modules.
    • Document module-specific workflows (e.g., "How to add a widget to InventoryModule").

Operational Impact

Maintenance

  • Pros:
    • Isolated Dependencies: Modules encapsulate Filament components, reducing merge conflicts.
    • Granular Updates: Update modules independently (e
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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor