diff --git a/src/Illuminate/Foundation/Console/AppNameCommand.php b/src/Illuminate/Foundation/Console/AppNameCommand.php index 111147552c95..923654f3a644 100644 --- a/src/Illuminate/Foundation/Console/AppNameCommand.php +++ b/src/Illuminate/Foundation/Console/AppNameCommand.php @@ -238,7 +238,9 @@ protected function setDatabaseFactoryNamespaces() */ protected function replaceIn($path, $search, $replace) { - $this->files->put($path, str_replace($search, $replace, $this->files->get($path))); + if ($this->files->exists($path)) { + $this->files->put($path, str_replace($search, $replace, $this->files->get($path))); + } } /**