Skip to content

Commit

Permalink
Merge branch 'improve_controller_generator' of https://github.com/sil…
Browse files Browse the repository at this point in the history
…eence/laravel-framework into sileence-improve_controller_generator
  • Loading branch information
taylorotwell committed Jan 27, 2017
2 parents 6f2395d + 6213395 commit 350595c
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 350595c

Please sign in to comment.