diff --git a/src/Illuminate/Console/GeneratorCommand.php b/src/Illuminate/Console/GeneratorCommand.php index 65203f9c8e25..97d4c49d9da4 100644 --- a/src/Illuminate/Console/GeneratorCommand.php +++ b/src/Illuminate/Console/GeneratorCommand.php @@ -87,7 +87,7 @@ protected function alreadyExists($rawName) */ protected function getPath($name) { - $name = str_replace($this->laravel->getNamespace(), '', $name); + $name = str_replace_first($this->laravel->getNamespace(), '', $name); return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; }