internachi/modular
A lightweight module system for Laravel apps using Composer path repositories and Laravel package discovery. Create self-contained modules in an app-modules/ directory, following standard Laravel package conventions with minimal extra tooling.
Modular Architecture for Large-Scale Laravel Apps:
Enables teams to decompose monolithic applications into self-contained modules (e.g., auth, payments, analytics), improving maintainability, scalability, and team autonomy. Aligns with Laravel’s native conventions (e.g., packages, service providers) rather than forcing custom patterns.
Build vs. Buy: Buy: Adopt this package to avoid reinventing module systems (e.g., custom Composer path repositories, auto-discovery logic). Reduces technical debt compared to rolling out a bespoke solution. Build: Consider building a custom solution only if you need dynamic module loading/unloading (e.g., plugin systems for CMS platforms) or non-Laravel-specific features (e.g., cross-framework compatibility).
Roadmap Priorities:
Use Cases:
invoice module).app/ directory.nwidart/laravel-modules instead.routes/modules/*.php)."This package lets us build Laravel apps like LEGO blocks—each module is a self-contained feature (e.g., ‘Payments,’ ‘User Profiles’) that teams can develop, test, and deploy independently. Here’s why it’s a game-changer for [Project Name]:
Faster Development:
dashboard, backend owns api). No more merge hell in app/Http/Controllers/.auth module can be updated without touching the inventory module.Scalability:
marketing module for promotions can be added in hours, not weeks.payments module → separate microservice).Risk Reduction:
subscription module can be A/B tested independently.Cost Savings:
Future-Proof:
notifications module could be sold as a standalone package to other clients.Ask: Should we pilot this with our next major feature (e.g., analytics module) to prove the benefits before full adoption?"
"This is a lightweight, Laravel-first module system that solves our biggest pain points: organization and scalability. Here’s how it works and why it’s better than alternatives:
Key Features:
php artisan make:module payments → scaffolds a app-modules/payments/ directory with src/, routes/, database/, etc.make: commands with --module flag (e.g., make:controller UserController --module=auth).modules:cache command).Why Not nwidart/laravel-modules?
Migration Path:
auth) into a module.modules:sync to update IDE configs and phpunit.xml.reports, api) into modules.Risks/Mitigations:
use App\Models\User in modules; use interfaces/DTOs).modules:sync once; PhpStorm will auto-detect modules.Next Steps:
logs) to validate the workflow.modules:list to our deployment scripts to audit enabled modules.Ask: Should we allocate a sprint to prototype this with the auth module?"
How can I help you explore Laravel packages today?