Skip to content

[5.4] add force option to some generators#19932

Merged
taylorotwell merged 2 commits into
laravel:5.4from
browner12:command-override
Jul 6, 2017
Merged

[5.4] add force option to some generators#19932
taylorotwell merged 2 commits into
laravel:5.4from
browner12:command-override

Conversation

@browner12
Copy link
Copy Markdown
Contributor

this will allow the user to continue execution of the command even if the class already exists.

Example:

User types php artisan make:model Blog but forgets to add the -mcr flags to make their migration and resource controller. Currently they would either have to write the migration and controller command themselves

php artisan make:migration create_blogs_table --table=blogs
php artisan make:contoller BlogController --model=/App/Blog

or they could delete the Blog model and run the command again with the flags.

php artisan make:model Blog -mcr

What this change allows us to do is run the flag commands immediately after the original command.

php artisan make:model Blog -mcrf

This will still realize the model already exists and not try to create it again, but it will not return false and halt execution of the flagged commands.

browner12 added 2 commits July 6, 2017 15:23
this will allow the user to continue execution of the command even if the class already exists.
@taylorotwell taylorotwell merged commit aba84b7 into laravel:5.4 Jul 6, 2017
@browner12 browner12 changed the title add force option to some generators [5.4] add force option to some generators Jul 6, 2017
@browner12 browner12 deleted the command-override branch July 6, 2017 22:10
@vicgonvt
Copy link
Copy Markdown
Contributor

👍

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.

3 participants