diff --git a/src/Illuminate/Foundation/Console/KeyGenerateCommand.php b/src/Illuminate/Foundation/Console/KeyGenerateCommand.php index ca6f3ffbd359..2bd384d45da0 100644 --- a/src/Illuminate/Foundation/Console/KeyGenerateCommand.php +++ b/src/Illuminate/Foundation/Console/KeyGenerateCommand.php @@ -41,7 +41,10 @@ public function fire() { $contents = $this->files->get($path = $this->laravel['path'].'/config/app.php'); - $contents = str_replace('YourSecretKey!!!', $key = $this->getRandomKey(), $contents, $count); + $content = explode("'key' => '", $contents); + $content = explode("',", $content[1]); + + $contents = str_replace($content[0], $key = $this->getRandomKey(), $contents, $count); if ($count == 0) { @@ -67,4 +70,4 @@ protected function getRandomKey() return substr(str_shuffle(str_repeat($pool, 5)), 0, 32); } -} \ No newline at end of file +}