coolsam/modules
Filament Modules v5 wraps nwidart/laravel-modules to turn each Laravel module into an autonomous Filament plugin with its own resources, pages, widgets, and clusters. Register ModulesPlugin once and it auto-discovers modules. Supports Laravel 11–13 and Filament 4–5.
What the package actually is. coolsam/modules is a thin adapter layer: it wraps nwidart/laravel-modules and exposes each module as a Filament Plugin, with a single ModulesPlugin registered in a panel performing bulk discovery of module resources, pages, widgets, clusters, and nested panels. It is not a module system of its own — it inherits nwidart's runtime, config, and directory conventions, and inherits Filament's plugin/panel registration model.
Architecture fit. Good fit only if modular monolith organization is already a decided requirement. The package's value proposition is code reuse across projects and panel isolation per module; both are architectural commitments, not conveniences. Teams that merely want tidier app/Filament folders should not take this on — they'd be adopting two coupled frameworks (nwidart + Filament plugin lifecycle) to solve a directory problem. Where it fits well: multi-brand or multi-tenant admin suites, agency/white-label reuse, and large panels where one-cluster-per-domain gives the IA for free.
Integration feasibility. Low write-cost, moderate read-cost. The install surface is small — composer require, modules:install, add ->plugin(ModulesPlugin::make()) — but it is a second-order dependency: nwidart must be installed, configured, and autoloaded via Composer's merge-plugin before the wrapper does anything. That autoload requirement is the real integration risk; it changes how composer install behaves in CI and in production images, not just what's in vendor/.
| Dimension | Assessment |
|---|---|
| Code surface to adopt | Small (one plugin registration, one config publish) |
| Prerequisites to satisfy | Non-trivial (nwidart setup, merge-plugin autoload, module scaffolding) |
| Coupling introduced | Triple: Laravel major ↔ Filament major ↔ laravel-modules major, all gated by this package's version |
| Reversibility | Moderate — modules can be flattened back into app/ with effort; panel/cluster IA choices harder to unwind |
Technical risk.
Coolsam\Modules\Resource/Page/*Widget base classes or mix in CanAccessTrait. Swapping base classes as a security control is fragile: any resource that still extends Filament's base class silently lacks the protection, with no compile-time or startup signal. For an admin panel, that is the highest-severity item in this evaluation.auto-register-plugins plus mode: plugins|panels|both means resources can appear or disappear from navigation based on config and discovery rather than explicit provider registration. Failures skew toward silent omission, not loud errors.Key questions to resolve before committing.
plugins, panels, or both? Panel-per-module multiplies navigation, auth, and theming surface; plugins only is dramatically cheaper.canAccess + Shield/permission integration)?merge-plugin autoloading of Modules/*/composer.json, including in optimized/--no-dev builds?Stack fit. Assume Laravel 12 + Filament 4 as the target, not the newest cells of the matrix. The package supports Laravel 13 / Filament 5, but landing a pilot on the trailing edge of both the framework and the wrapper's newest supported range maximizes the number of moving parts simultaneously in flux. PHP 8.3 minimum is uncontroversial. If the app already uses spatie/laravel-permission and Filament Shield, verify interaction with module-scoped policies before enabling panels mode — that combination is the least documented.
Migration path.
| Phase | Action | Exit criterion |
|---|---|---|
| 0 — Spike | Throwaway branch or scratch app. Install nwidart + package, one module, one generated resource, one cluster. Break it deliberately (remove a module, change mode). | Team can articulate exactly what discovery does and what fails silently |
| 1 — nwidart alone | Adopt nwidart/laravel-modules for one bounded domain, no Filament wrapper. Prove merge-plugin autoload in local, CI, and production image builds. |
composer install --no-dev -o works in the deploy pipeline; module classes resolve |
2 — Wrapper, mode: plugins |
Enable ModulesPlugin with plugins-only mode, no clusters. One module, one resource. |
Resource renders in the existing admin panel; nav unchanged otherwise |
| 3 — Clusters | Enable clusters.enabled for IA. Move one domain's resources in. |
Navigation remains comprehensible; no duplicate registration |
| 4 — Panels (optional) | Only if strict per-module panel isolation is a stated requirement. | Auth/theme/nav back-links verified per panel |
| 5 — Reuse | Extract a second project consuming the same module. | A module is versioned and consumed by two apps without forking |
Stop at any phase whose benefit doesn't materialize. Phase 1 is the cheapest place to discover the architecture isn't worth it; phase 5 is the only phase that validates the package's actual pitch.
Compatibility. Pin exact versions (coolsam/modules, nwidart major, Filament minor) and record the matrix in an ADR. Treat the package's version as part of the framework upgrade checklist, not an incidental dependency. Note that the wrapper deliberately does not override Filament's per-panel discovery model — resources bind to panels via the panel provider's discover*() calls, so per-panel scoping is our responsibility, not the package's, and is where mistakes concentrate.
Sequencing. Front-load the two highest-uncertainty items: Composer autoloading in production builds (phase 1) and access control enforcement (independent of phase, but decided before any module ships to users). Defer panels mode until clusters have proven the IA; it's the option with the most blast radius and the least documentation.
Maintenance. Budget for community-supported, not vendor-supported. Low fork cost is the mitigation: pin the version, keep a short patch queue, and pre-identify the two or three extension points we'd need to patch for a Filament major (plugin registration, discovery, cluster wiring). A single thin wrapper is a reasonable thing to own — a single thin wrapper nobody has looked at in six months is not. Assign an owner and a quarterly "still current on Filament majors?" review.
Support. GitHub issues, no SLA. Internal runbook must cover: how to add a module, how to debug a resource not appearing, how to verify autoload in a fresh clone, and how to flatten a module back into app/ if we walk away. The README is solid for the happy path and explicitly WIP elsewhere — do not assume WIP sections will be resolved on a schedule that matches ours.
Scaling. Runtime overhead is registration/discovery at boot, which is cacheable — ensure config:cache, route:cache, and Filament's component caching are in place, and measure boot time once module count exceeds roughly a dozen. Team scaling is the bigger constraint: modules encourage ownership boundaries, but only if we also enforce them with CODEOWNERS and per-module CI jobs. Without that, modules become a shared mutable namespace with extra indirection.
Failure modes to instrument.
merge-plugin behavior differs between local and an optimized --no-dev build, producing class-not-found at boot. Mitigation: build the production image in CI on every PR, not just on release.Ramp-up. A Filament-fluent developer is productive in half a day to a day; the commands are self-documenting and the conventions are Filament's. The real ramp cost is conceptual: the team must hold three mental models (Laravel service providers, nwidart modules, Filament plugins/panels) and know which layer resolves a given file. Expect a week of confusion around "where does this resource actually get registered" before it clicks. Write the internal conventions doc in phase 2, while the confusion is fresh.
Verdict for a TPM. Composite score of 25 and opportunity of 27 is consistent with what the artifact shows: a useful, competently built thin adapter with a narrow audience, one maintainer, and unresolved WIP in exactly the areas (access control, widgets, themes) that production admin panels care about. Recommend a time-boxed pilot gated at phase 2, with an explicit decision point on whether cross-project module reuse is real. Do not adopt it as a platform-level dependency on the strength of the README alone, and do not adopt it to solve folder organization.
How can I help you explore Laravel packages today?