-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[5.5] Add prompt to vendor:publish to specify which provider/tag to publish #18230
Conversation
could you make option this is awesome, BTW. |
Very cool feature, I think its very useful, good job! |
return $this->choice( | ||
"Which package's files would you like to publish?", | ||
ServiceProvider::providersAvailableToPublish() | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might work
$choice = $this->choice(
"Which package's files would you like to publish?",
array_merge(
['All'],
ServiceProvider::providersAvailableToPublish()
),
0
);
return $choice === 'All' ? null : $choice;
Is there is a way to skip command prompt? It will be useful for deploy automation tools. |
you can still use the |
@browner12 thanks! Don't know why I've missed that from first comment. |
Great stuff! |
Does this also show available tags? |
Publishable tags have now been added as choices in the prompt. Gif has been updated to show what it looks like. |
this update seems a little strange to me. aren't tags a subset of a provider? Wouldn't you first select a provider, and then (if it has them) select the tag after that? Is it possible to do a two step choice like this with the command? |
Tags are a subset but they can be shared across multiple packages. So this lets you publish all the I'm OK with this functionality. If someone wants to publish only the |
Nice addition @fitztrev! |
This is awesome! |
What i want! Awesome! |
@fitztrev Maybe functionality to publish specific tags and providers like: 4,2,8 in same time. |
@juniorb2ss it's just an interface on top of the |
By default,
artisan vendor:publish
will publish everything it can find. Passing the--provider
flag is the way around this but you have to lookup the package's service provider class name along with its namespace (long and inconsistent naming across packages).This pull request adds a prompt to allow the user to specify the package for which they want to publish files.
Prompt can be avoided by using the
--all
flag or by continuing to pass a--provider
.Edit: Updated screen capture gif below
