[5.7] Enable passing options to custom presets #25930
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ability to create our own presets is very convenient. But currently it is not possible to have customization in the user made preset commands by passing options to it. For example if i am making a preset for tachyon css and want the dev to choose a js framework from either vue or react along with the choice of creating auth pages or not, its not possible with
php artisan preset tachyon
alone.This pr enables passing of multiple values to the custom presets through
--option=
, which can be used as ...php artisan preset tachyon --option=vue --option=cdn --option=version:4.0
orphp artisan preset tachyon --option=react --option=auth
.
This opens many possibilities for creating presets which will simplify and make frontend dev much faster.
This is a non breaking change and works as intended without affecting the default presets.
The array of values passed can be accessed in the following way.