/** * Show new migrations. * * @return void */ protected function showNewMigrations() { $new = collect($this->migrator->getMigrationsToRun()); $this->output->writeln("<fg=green>New migrations:\r\n</>"); foreach ($new as $migration) { $this->output->writeln("<fg=green>{$migration}.php</>"); } }
/** * Execute the console command. * * @return null|int */ protected function fire() { $toRun = $this->migrator->getMigrationsToRun(); if (!empty($toRun)) { foreach ($toRun as $migration) { $this->migrator->runMigration($migration); $this->message("<info>Migrated:</info> {$migration}.php"); } } else { $this->info('Nothing to migrate'); } }