From 6740d50b1337cffcd505caa6f771227dd50f9fbd Mon Sep 17 00:00:00 2001 From: Melek REBAI Date: Tue, 20 Feb 2018 12:25:19 +0100 Subject: [PATCH] [5.6] Fix --force on GeneratorCommand When the --force option is used the command should generate and override an existing file --- 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;