alizharb/laravel-modular
Laravel Modular is a strictly typed modular system for Laravel 11/12/13 with zero config. Over 29 native Artisan commands support --module, plus dependency-aware boot ordering, caching, auto-discovery, and production diagnostics.
modules/Shop, modules/Blog) with strict dependency ordering (topological boot resolution), without paying the distributed-systems tax. That's a roadmap-level decision this package directly de-risks.--module flag means near-zero retraining cost — the counterfactual cost is real and this collapses it.module:enable / module:disable plus @moduleEnabled Blade directives turn modules into runtime feature flags — enabling tiered plans, per-tenant entitlement sets, or add-on packs without redeploying divergent codebases. That is a product decision, not just an engineering one.modular:export promotes a module to a standalone Composer package — a viable path for customer-specific builds or spinning a module out as a sellable product.modular:migrate, modular:test, modular:npm, and per-module stubs let squads own a vertical slice end-to-end with enforced conventions. Supports decisions about how many squads we can add before coordination cost dominates.modular:export gives a low-friction exit into a service or package. That reduces the irreversibility of committing to the monolith.Consider it when:
modular:sync and disabling composer-merge-plugin in production, and modular:cache in the deploy pipeline.Look elsewhere when:
app/ conventions and plain namespaces will cost less than any module system.nwidart/laravel-modules is the incumbent and warrants a formal head-to-head before adoption. Run both against our actual generator and migration workflows.Recommendation: bounded pilot, not a platform commitment. Adopt on one non-critical module for two sprints; exit criteria = no measurable prod overhead after modular:cache, generators used by the team unaided, and a clean modular:export of that module.
To executives: We're choosing an application structure now that will constrain how fast we can ship and how we package what we sell for the next several years. This package gives us a modular monolith — separated domains inside one deployable — with per-module on/off switches. Practically: we can sell tiered or per-customer feature sets without running separate codebases, onboard a new squad without them colliding with existing ones, and later extract a module into its own product or service without a rewrite. The cost is a small integration effort and a dependency that is early-stage and single-maintainer — which we mitigate by piloting it on one non-critical module and keeping the MIT-licensed fork option open. I'm asking for a two-sprint pilot, not a platform bet.
To engineering: No new mental model. The standard commands you already type — make:model, make:controller, make:migration — take a --module flag and behave as you expect, with -mcf and --all intact. You get zero-config autoloading via a Composer merge plugin, topological dependency resolution so base modules boot first, auto-discovery of commands, policies, and listeners, module-scoped migrations/seeds/tests, and per-module stubs to enforce conventions. Discovery caching means near-zero production overhead; the README is explicit that we should run modular:sync and drop the merge plugin before shipping. Vite and NPM workspaces are supported per module, so frontend ownership isn't blocked. The risks are maturity and bus factor — 23 stars, no downstream dependents — so we pin a version, review the changelog before upgrades, and treat the pilot as an evaluation with a real off-ramp.
How can I help you explore Laravel packages today?