diff --git a/src/Illuminate/Foundation/Console/PolicyMakeCommand.php b/src/Illuminate/Foundation/Console/PolicyMakeCommand.php index 3dbf950fe2cb..367c7da487a3 100644 --- a/src/Illuminate/Foundation/Console/PolicyMakeCommand.php +++ b/src/Illuminate/Foundation/Console/PolicyMakeCommand.php @@ -82,6 +82,11 @@ protected function replaceModel($stub, $model) $stub = str_replace('NamespacedDummyModel', $this->laravel->getNamespace().$model, $stub); } + $namspaceModel = $this->laravel->getNamespace().$model; + + $stub = str_replace("use {$namspaceModel};\nuse {$namspaceModel};", + "use {$namspaceModel};", $stub); + $model = class_basename(trim($model, '\\')); $stub = str_replace('DummyModel', $model, $stub);