diff --git a/src/Illuminate/Foundation/Console/KeyGenerateCommand.php b/src/Illuminate/Foundation/Console/KeyGenerateCommand.php index c29bfd40f3e8..977a4ed3f1a3 100755 --- a/src/Illuminate/Foundation/Console/KeyGenerateCommand.php +++ b/src/Illuminate/Foundation/Console/KeyGenerateCommand.php @@ -34,14 +34,13 @@ public function fire() return $this->line(''.$key.''); } - foreach ([base_path('.env'), base_path('.env.example')] as $path) + $path = base_path('.env'); + + if (file_exists($path)) { - if (file_exists($path)) - { - file_put_contents($path, str_replace( - $this->laravel['config']['app.key'], $key, file_get_contents($path) - )); - } + file_put_contents($path, str_replace( + $this->laravel['config']['app.key'], $key, file_get_contents($path) + )); } $this->laravel['config']['app.key'] = $key;