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.
nwidart/laravel-modules’s rigid module hierarchy).app-modules/). Ideal for medium-to-large Laravel apps where organization is critical but extraction flexibility is desired.Modules\ namespace to a vendor prefix). The MIT license and lack of dependents suggest low vendor lock-in.config/app.php). The composer update step after module creation is the only explicit action required.make: commands with --module= flags, preserving existing workflows (e.g., make:controller --module=users).<x-module::component>) and anonymous components, matching Laravel’s Blade ecosystem.phpunit.xml and PhpStorm configs to avoid IDE misconfigurations.app-modules/ for auto-discovery could slow large projects. The modules:cache command mitigates this but adds operational complexity.settings.json adjustments for path resolution.nwidart/laravel-modules, modules cannot be enabled/disabled at runtime. This is a design choice (focus on organization, not CMS-like extensibility), but could limit use cases requiring runtime flexibility.factory() and make:test, no built-in module-specific test isolation (e.g., parallel test execution). Tests run in the global app context.nwidart/laravel-modules)?InterNACHI\ example) hints at this, but the process isn’t documented.composer update modules/* affect CI pipelines? Caching strategies (e.g., modules:cache) may be needed.nwidart/laravel-modules).app/) interact with modules? No forced migration path—teams must opt in per feature.modules:sync (auto-updates IDE configs).app/ directory usage. Identify candidates for modularization (e.g., Users, Payments, Reports).App\Modules\ vs. InterNACHI\).composer require internachi/modular.php artisan vendor:publish --tag=modular-config (customize namespace).php artisan modules:sync (updates phpunit.xml, PhpStorm configs).Users).app/Http/Controllers/UserController.php → app-modules/users/src/Http/Controllers/UserController.php).php artisan modules:cache (improves performance).| Feature | Compatibility | Notes |
|---|---|---|
| Laravel Packages | ✅ Full support (auto-discovery) | Uses Laravel’s package system. |
| Artisan Commands | ✅ Extended with --module= flag |
All make: commands + db:seed. |
| Blade Components | ✅ Namespace support (<x-module::component>) |
Anonymous components also supported. |
| Migrations/Seeders | ✅ Auto-discovered | No custom CLI; uses Laravel’s migrator. |
| Factories | ✅ Auto-loaded | Works with Laravel’s factory system. |
| Policies/Events | ✅ Auto-discovered | Follows Laravel conventions. |
| Livewire | ✅ Partial (if installed) | make:livewire support added in v1.5.0. |
| Translations | ✅ Namespace support (demo::messages.welcome) |
Standard Laravel translation system. |
| Custom Stubs | ✅ Publishable (app-modules.php) |
Extendable for project-specific templates. |
| PhpStorm/VSCode | ✅ Auto-sync via modules:sync |
Reduces manual config drift. |
| Windows Paths | ⚠️ Fixed in v1.10.0 | Historical quirks; test thoroughly. |
| Composer 2.x | ✅ Supported | No issues reported. |
| Laravel Mix/Vite | ❌ No direct support | Modules must manually include assets in resources/js/css. |
| Queue Workers | ✅ Jobs auto-discovered | No special handling needed. |
| API Resources | ✅ Auto-discovered | Uses Laravel’s make:resource. |
modules:sync.composer update modules/*.How can I help you explore Laravel packages today?