nwidart/laravel-modules
Modularize large Laravel apps with nwidart/laravel-modules. Create self-contained modules (controllers, models, views, routes, config) with Artisan generators, module discovery, enabling/disabling, and per-module resources—tested and maintained across modern Laravel versions.
Auth, Payments, Inventory). This aligns with the "microservices-lite" pattern, improving maintainability and team autonomy without full microservice complexity.module:disable Payments during a refactor) to isolate work in progress. Supports canary releases or A/B testing by toggling modules per environment.composer.json merging, route isolation, or namespace handling). The package handles 90% of modularity boilerplate, reducing dev time by weeks.Auth, Billing) to parallelize development.RouteServiceProviders.TenantA/Payments, TenantB/Invoicing) as modules.module:make Controller UserProfile).vendor/module-paypal).Adopt if:
User, Order, Payment).Analytics module for GDPR compliance).php artisan module:seed Payments).FileActivator).Look elsewhere if:
composer merge-plugin).*"This package lets us scale development teams without technical debt by breaking our monolith into independent modules—like Lego blocks for features. For example:
Modules/Auth without blocking the Payments team.Marketing during outages) without redeploying.module-stripe) via Composer.
Cost: ~2 dev-days to migrate; ROI: Faster releases, easier hiring, and future microservice readiness."**"Laravel-Modules solves 5 critical pain points in large apps:
Modules\Payments\Controllers\CheckoutController).RouteServiceProvider (no more routes/web.php bloat).resources/js/modules/payments/).Modules/Analytics during GDPR audits with php artisan module:disable Analytics.php artisan module:make Payments).
Tradeoff: Slightly slower composer install (due to merge-plugin), but worth it for maintainability."**"This aligns with Domain-Driven Design (DDD) by enforcing:
Modules/Inventory vs. Modules/Shipping).FileActivator) or filesystem (default).
Risk: Over-modularization can fragment team knowledge—mitigate with module ownership (e.g., team-payments owns Modules/Payments)."*How can I help you explore Laravel packages today?