Skip to content

Commit

Permalink
fix #15570 by replacing only the first instance of the app namespace (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid authored and taylorotwell committed Sep 23, 2016
1 parent de8c117 commit 574848f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Console/GeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

1 comment on commit 574848f

@vlakoff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Str::replaceFirst() would be a better fit.

Please sign in to comment.