diff --git a/src/Illuminate/Foundation/Console/ModelMakeCommand.php b/src/Illuminate/Foundation/Console/ModelMakeCommand.php index 6813167c0f59..60efccc28d3a 100644 --- a/src/Illuminate/Foundation/Console/ModelMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ModelMakeCommand.php @@ -73,9 +73,11 @@ protected function createController() { $controller = Str::studly(class_basename($this->argument('name'))); + $modelName = $this->qualifyClass($this->getNameInput()); + $this->call('make:controller', [ 'name' => "{$controller}Controller", - '--resource' => $this->option('resource'), + '--model' => $this->option('resource') ? $modelName : null, ]); }