From d4d55149d64f81162ea9741d7507f23cd2b1cfc8 Mon Sep 17 00:00:00 2001 From: Melek REBAI Date: Wed, 7 Mar 2018 17:58:04 +0100 Subject: [PATCH] [5.5] Fix --force on GeneratorCommand Already merged on 5.6 https://github.com/laravel/framework/pull/23230 Adding the bug fix on 5.5 LTS --- src/Illuminate/Console/GeneratorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Console/GeneratorCommand.php b/src/Illuminate/Console/GeneratorCommand.php index 3dd7774442d5..92f97876492b 100644 --- a/src/Illuminate/Console/GeneratorCommand.php +++ b/src/Illuminate/Console/GeneratorCommand.php @@ -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;