Description
PR #1498 added multi-name support to make:command, make:controller, make:middleware and make:request (fixes goravel/goravel#880):
./artisan make:controller UserController OrderController
This issue extends the same behavior to the remaining make:* commands, so all of them accept multiple names in a single invocation (mirroring mkdir).
Tasks
Additional requirements
Acceptance criteria
./artisan make:model User Task # creates both models
./artisan make:event UserRegistered OrderShipped # creates both events
./artisan make:view home about # creates home.tmpl, about.tmpl
./artisan make:package blog docs # creates two package scaffolds
./artisan make:model User Order --table=users # → error: --table requires a single name
References
Description
PR #1498 added multi-name support to
make:command,make:controller,make:middlewareandmake:request(fixes goravel/goravel#880):This issue extends the same behavior to the remaining
make:*commands, so all of them accept multiple names in a single invocation (mirroringmkdir).Tasks
Handleinto aMakeNamesloop +makeOne(ctx, name)method (same pattern as feat: [#880] make commands accept multiple names #1498)make:model—database/console/model_make_command.gomake:seeder—database/console/seeder_make_command.gomake:factory—database/console/factory_make_command.gomake:observer—database/console/observer_make_command.gomake:migration—database/console/migration/migrate_make_command.gomake:channel—broadcasting/console/channel_make_command.gomake:policy—auth/console/policy_make_command.gomake:notification—notification/console/make_command.gomake:mail—mail/console/mail_make_command.gomake:provider—foundation/console/provider_make_command.gomake:test—foundation/console/test_make_command.gomake:tool—ai/console/tool_make_command.gomake:agent—ai/console/agent_make_command.gomake:job—queue/console/job_make_command.gomake:listener—event/console/listener_make_command.gomake:event—event/console/event_make_command.gomake:rule—validation/console/rule_make_command.gomake:filter—validation/console/filter_make_command.gomake:view—view/console/view_make_command.go(add interactiveAskprompt on empty name, then loop)make:package—foundation/console/package_make_command.go(loop over multiple package names)Additional requirements
--table(make:model) and--model(make:migration) to single-name invocations — error out when combined with more than one name (declare the error as a named variable inerrors/list.go, not inline)make:command SomeNamewithout a sub-directory (e.g.CleanCachevsGoravel/CleanCache) registers&commands.CleanCache{}inkernel.go, corrupting it. Either register it correctly or fail with a clear messageTestXxxMakeCommand_MultipleNamesfor every command--table/--modelcombined with multiple namesAcceptance criteria
References