diff --git a/src/Commands/MigrateMake b/src/Commands/MigrateMake new file mode 100644 index 00000000..d202a412 --- /dev/null +++ b/src/Commands/MigrateMake @@ -0,0 +1,39 @@ +signature .= ' + {--tenant : Create migration file in the tenant migrations directory.} + '; + + parent::__construct($creator, $composer); + } + + /** + * Get migration path (either specified by '--path' option or default location). + * + * @return string + */ + protected function getMigrationPath(): string + { + if (! is_null($targetPath = $this->input->getOption('path'))) { + return ! $this->usingRealPath() + ? $this->laravel->basePath().'/'.$targetPath + : $targetPath; + } + + if ($this->hasOption('tenant') && $this->option('tenant')) { + return parent::getMigrationPath().DIRECTORY_SEPARATOR.'tenant'; + } + + return parent::getMigrationPath(); + } +}