Use case
I'm building a modular monolith where one top-level module (service) owns a
group of submodules (branches, reservations, workers, gallery, etc.).
These submodules don't exist independently — they are part of the service domain.
The folder structure looks like this:
app-modules/
├── service/
│ └── app-modules/
│ ├── branches/
│ ├── reservations/
│ ├── workers/
│ └── gallery/
└── ecommerce/
This works fine at the Composer level — each submodule has its own composer.json,
ServiceProvider, routes, and migrations. Composer resolves the dependency tree
correctly regardless of nesting depth.
The problem
There's no way to run make:module for submodules. The command always reads
modules_directory from config/app-modules.php, which points to a single
root directory. There's no way to target a subdirectory like
app-modules/service/app-modules/.
Proposed solution
A --inside flag for make:module:
php artisan make:module branches --inside=service
This would create the module inside app-modules/service/app-modules/branches/
instead of app-modules/branches/, and register it in
app-modules/service/composer.json instead of the root composer.json.
Why not flat modules?
Putting branches, reservations, etc. at the same level as service or
ecommerce misrepresents the actual architecture. These submodules have no
meaning outside of service. The nesting is not cosmetic — it reflects real
domain ownership and dependency direction.
I'd be happy to implement this if the approach looks good to you.
Use case
I'm building a modular monolith where one top-level module (
service) owns agroup of submodules (
branches,reservations,workers,gallery, etc.).These submodules don't exist independently — they are part of the
servicedomain.The folder structure looks like this:
app-modules/
├── service/
│ └── app-modules/
│ ├── branches/
│ ├── reservations/
│ ├── workers/
│ └── gallery/
└── ecommerce/
This works fine at the Composer level — each submodule has its own composer.json,
ServiceProvider, routes, and migrations. Composer resolves the dependency tree
correctly regardless of nesting depth.
The problem
There's no way to run
make:modulefor submodules. The command always readsmodules_directoryfromconfig/app-modules.php, which points to a singleroot directory. There's no way to target a subdirectory like
app-modules/service/app-modules/.Proposed solution
A
--insideflag formake:module:php artisan make:module branches --inside=service
This would create the module inside
app-modules/service/app-modules/branches/instead of
app-modules/branches/, and register it inapp-modules/service/composer.jsoninstead of the rootcomposer.json.Why not flat modules?
Putting
branches,reservations, etc. at the same level asserviceorecommercemisrepresents the actual architecture. These submodules have nomeaning outside of
service. The nesting is not cosmetic — it reflects realdomain ownership and dependency direction.
I'd be happy to implement this if the approach looks good to you.