Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Generate default command name based on class name #46256

Merged
merged 3 commits into from
Feb 25, 2023
Merged

[10.x] Generate default command name based on class name #46256

merged 3 commits into from
Feb 25, 2023

Conversation

iamgergo
Copy link
Contributor

@iamgergo iamgergo commented Feb 24, 2023

This PR changes the default command:name based on the current app namespace and the command class name.


I know there is a --command option, but – at least for me – it feels a bit more streamlined generating a default command name based on the given class.

For example the php artisan make:command MigrateOldDb will generate $signature = 'app:migrate-old-db'.


Right now, it uses the application namespace. So, when changing from the default App namespace, the generated command signature will change as well. For example if the base namespace is Laravel\Forge, the generated command signature will be laravel-forge:migrate-old-db.

To simplify this, we might just use the app: prefix, since by using the --command option, the command name can be changed easily.


I didn't find tests related to the make:* commands. Am I missing something? If you're willing to merge, I would gladly add some tests as well.

Thanks.

@taylorotwell taylorotwell merged commit 3b7f6d0 into laravel:10.x Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants