Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions src/Commands/MigrationMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,17 @@ protected function makeMigration()
*/
protected function makeModel()
{
$modelPath = $this->getModelPath($this->getModelName());

if ($this->option('model') && !$this->files->exists($modelPath)) {
$this->call('make:model', [
'name' => $this->getModelName()
]);
if ($this->option('model')) {
$modelPath = $this->getModelPath($this->option('model'));

if (!$this->files->exists($modelPath)) {
$this->call('make:model', [
'name' => $modelPath
]);
}
}
}

/**
* Build the directory for the class if necessary.
*
Expand Down Expand Up @@ -213,16 +215,6 @@ protected function replaceSchema(&$stub)
return $this;
}

/**
* Get the class name for the Eloquent model generator.
*
* @return string
*/
protected function getModelName()
{
return ucwords(str_singular(camel_case($this->meta['table'])));
}

/**
* Get the console command arguments.
*
Expand Down