-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[11.x] Support Single and Multi-Selection for Publishing Stubs #53757
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
Conversation
|
I think we should limit this prompt to the most commonly customized stubs and give them human friendly names rather than file names. 👍 |
|
Couple of notes here... I think things like Controllers should probably be grouped like
That being said, the amount of controller stubs we have makes me sad and makes the menu feel a bit confusing 🥲 ... not sure what to do about that. There would be 12 entries just for controllers. |
|
Thanks! I completely understand your concerns about the number of stubs and the potential confusion in the menu. I’ve been thinking about ways to address this and wanted to reach out to the community for feedback on a balance between flexibility and simplicity, but I haven’t landed on a solid solution yet. Here are a few ideas I’ve been considering:
I’d love to hear the thoughts of others in the community. If anyone has suggestions or experiences that might help determine the best path forward, please share! |
|
I would love to see this @ahinkle. I agree with @taylorotwell that the amount of controller stubs is a bit intense 😅 I just started up a project I plan to host on Laravel Cloud and had some customizations I wanted to make to the stubs (I am looking at you I believe making this change also keeps with the theme of having a more streamlined application structure that was introduced in Laravel 11 and makes the power of customization a lot simpler for the newbies :) I love the idea about grouping by category. This along with Laravel Prompts would create such a nice user experience. Looking forward to hopefully seeing this part of the framework! |
Good point. Maybe, it could reduce the number of stubs if the initial stubs for a project would be generated when needed from config, so they would be dynamic by nature, meaning, we wouldn't need some options at all, especially global ones. |


This PR adds support for single and multi-selection using Laravel Prompts in the
stub:publishartisan command.Screen.Recording.2024-12-04.at.10.43.23.AM.mov
The
stub:publishcommand currently publishes all customizable stubs, which now includes 52 stubs. With this change, it adds flexibility for developers who only need to customize a few specific stubs.You can now choose which stubs to publish directly from a selection menu, making it easier to target just the stubs you need.
--allOption: If you prefer to publish everything, the--allflag skips the menu and works just like it does today.Examples:
Interactive Mode:
Simply run:
and select one or more stubs from the list:

End Result:
Publish All:
Use the --all flag to publish everything at once: