Skip to content

Commit

Permalink
Fixes issue laravel#16575
Browse files Browse the repository at this point in the history
- add file exists check to ModelFactory.php file when performing app:name command
  • Loading branch information
ralphschindler committed Nov 29, 2016
1 parent 90791f6 commit 7a7bc0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Illuminate/Foundation/Console/AppNameCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ protected function setServicesConfigNamespace()
*/
protected function setDatabaseFactoryNamespaces()
{
$this->replaceIn(
$this->laravel->databasePath().'/factories/ModelFactory.php', $this->currentRoot, $this->argument('name')
);
$modelFactoryFile = $this->laravel->databasePath().'/factories/ModelFactory.php';
if ($this->files->exists($modelFactoryFile)) {
$this->replaceIn($modelFactoryFile, $this->currentRoot, $this->argument('name'));
}
}

/**
Expand Down

0 comments on commit 7a7bc0b

Please sign in to comment.