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] Allows specifying the name of the stubs to be published #49691

Closed
wants to merge 3 commits into from
Closed

[10.x] Allows specifying the name of the stubs to be published #49691

wants to merge 3 commits into from

Conversation

lukeraymonddowning
Copy link
Contributor

@lukeraymonddowning lukeraymonddowning commented Jan 15, 2024

Hey all,

This is a small PR that allows you to limit the stubs that are published when running php artisan stub:publish.

Usage

If you only want to publish stubs for migrations, execute php artisan stub:publish --only=migration. Any stubs that start with migration will be published.

If you omit the name, all stubs will be published as before. If no stubs match the given name, an error will be displayed to the user.

I contributed this because I'm often interested in editing just one stub, and don't want to have to delete all of the stubs that get published into the application. Thought is was a nice little DX improvement.

As always, thank you for your hard work.

Kind Regards,
Luke

@devajmeireles
Copy link
Contributor

Very nice addition! I noticed the command uses -- for other things, so wouldn't it be better to use --name?

Or even better: ... --only=migration

@lukeraymonddowning
Copy link
Contributor Author

@devajmeireles I like the --only option a lot. Updated 👌

@utsavsomaiya
Copy link
Contributor

May be After merging this #49698.

Please update the test case!

@devajmeireles
Copy link
Contributor

May be After merging this #49698.

Please update the test case!

This pull request was sent before of your. The correct is to do the inverse. Waiting for the merge of this to improve your pull request. I suggest you change your pull request to draft and mark this pull request.

@utsavsomaiya
Copy link
Contributor

May be After merging this #49698.

Please update the test case!

This pull request was sent before of your. The correct is to do the inverse. Waiting for the merge of this to improve your pull request. I suggest you change your pull request to draft and mark this pull request.

Okay! I will take care of it.

@taylorotwell
Copy link
Member

I kinda wonder if a better approach might be to group all stubs by "type" or something so we could surface this a bit better using Laravel Prompts?

@lukeraymonddowning
Copy link
Contributor Author

Makes sense! Would you be happy for me to work on that @taylorotwell?

@ahinkle
Copy link
Contributor

ahinkle commented Dec 6, 2024

Hey @lukeraymonddowning,

Ironically, I just came across this PR after working on a Laravel Prompts implementation myself a few days ago. I wanted to share that I’ve submitted a PR here: #53757

Feel free to provide any feedback. 👍

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.

5 participants