Skip to content

Commit

Permalink
[5.5] Fix --force on GeneratorCommand (#23427)
Browse files Browse the repository at this point in the history
Already merged on 5.6 laravel/framework#23230
Adding the bug fix on 5.5 LTS
  • Loading branch information
shadoWalker89 authored and taylorotwell committed Mar 7, 2018
1 parent b2f334f commit 3bb24c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function handle()
// First we will check to see if the class already exists. If it does, we don't want
// to create the class and overwrite the user's code. So, we will bail out so the
// code is untouched. Otherwise, we will continue generating this class' files.
if ($this->alreadyExists($this->getNameInput())) {
if ((! $this->hasOption('force') || ! $this->option('force')) && $this->alreadyExists($this->getNameInput())) {
$this->error($this->type.' already exists!');

return false;
Expand Down

0 comments on commit 3bb24c7

Please sign in to comment.