Skip to content

Commit

Permalink
Generate model with make:controller
Browse files Browse the repository at this point in the history
  • Loading branch information
sileence committed Jan 26, 2017
1 parent d6ef423 commit 6213395
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Illuminate/Routing/Console/ControllerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ protected function buildClass($name)
if ($this->option('model')) {
$modelClass = $this->parseModel($this->option('model'));

if (! class_exists($modelClass)) {
if ($this->confirm("The model $modelClass does not exist. Do you want to generate it?")) {
$this->call('make:model', ['name' => $modelClass]);
}
}

$replace = [
'DummyFullModelClass' => $modelClass,
'DummyModelClass' => class_basename($modelClass),
Expand Down

0 comments on commit 6213395

Please sign in to comment.