composer-merge-plugin.module.json, composer.json per module) is adaptable to other PHP frameworks with minimal effort.make:model --module) integrate natively, reducing friction for developers accustomed to vanilla Laravel.modular_vite() and module_asset() helpers, critical for modern SPAs.modular:migrate) and seeders enable per-module database management, mitigating global schema conflicts.modular:sync merges dependencies into root composer.json for production.modular:cache) mitigates runtime autoloading costs, but uncached environments may see latency spikes.app/ structure).Blog, Payments) or technical layers (e.g., Auth, API)?App\Services\Logger) be handled without violating the "Wall of Separation"?modular:sync be automated in CI, or will teams manually merge dependencies?Blog module’s API calls to Auth module)?modular:test and Pest for isolated module tests.vite.config.js per module?laravel-modular-livewire, laravel-modular-filament) enable seamless UI integration.module.json configuration.app/Http/Controllers referencing app/Models directly).Auth may stay in app/).laravel-modular and generate a pilot module (e.g., Blog).PostsController) into the module.modular:sync pre-deployment to merge module composer.json into root.composer-merge-plugin in production for performance.modules/{Module}/resources/js.vite.config.js to include modularLoader.Illuminate\Events) may require module-specific listeners.Modules\Blog\Jobs\PublishPost) to avoid namespace collisions.| Phase | Tasks | Tools/Commands |
|---|---|---|
| Setup | Install package, configure composer.json, run modular:install. |
composer require, modular:install |
| Module Creation | Generate first module (make:module Blog), define module.json. |
make:module, modular:list |
| Refactoring | Move models/controllers to module, update routes/service providers. | make:model --module, modular:check |
| Database | Run modular:migrate, test module-specific seeds. |
modular:migrate, modular:seed |
| Assets | Configure Vite workspaces, link assets (modular:link). |
modular:npm, modular_vite() |
| Testing | Write module tests, verify isolation with modular:test. |
Pest, modular:test |
| Deployment | Sync dependencies, cache discovery (modular:cache), disable merge-plugin. |
modular:sync, modular:cache |
composer.json reduces version conflict risks.Blog without touching Auth).modular:debug and modular:doctor provide module-specific diagnostics.make:module stubs requires global or per-module overrides..env) may need module-specific overrides (e.g., Blog::settings).module.json, and topological dependencies.modular:check detects these).composer dump-autoload or modular:cache).modular:link and Vite config).modular:doctor provides health scores and remediation steps.modular:cache) reduces autoloading overhead.Auth before Blog).Blog on DB1, Store on DB2).config('app.load_modules') to lazy-load modules.| Scenario | Impact | Mitigation Strategy |
|---|
How can I help you explore Laravel packages today?