/** * Creates the migration file for the given table. * @param TableMigration $table * @return mixed|string */ protected function createMigrationFile(TableMigration $table) { if ($table->needsLaravelModel()) { $this->call('make:model', ['name' => $table->getModelName(), '--migration' => true]); } else { $this->call('make:migration', ['name' => "create_{$table->getName()}_table", '--create' => $table->getName()]); } // else $migrationFiles = glob($this->getMigrationPath() . DIRECTORY_SEPARATOR . "*_create_{$table->getName()}_table.php"); return $migrationFiles ? end($migrationFiles) : ''; }