/** * Execute the console command. * * @return void */ public function fire() { $this->migrator->setConnection($this->option('database')); if (!$this->migrator->repositoryExists()) { return $this->error('No migrations found.'); } $ran = $this->migrator->getRepository()->getRan(); $migrations = Collection::make($this->getAllMigrationFiles())->map(function ($migration) use($ran) { return in_array($this->migrator->getMigrationName($migration), $ran) ? ['<info>Y</info>', $this->migrator->getMigrationName($migration)] : ['<fg=red>N</fg=red>', $this->migrator->getMigrationName($migration)]; }); if (count($migrations) > 0) { $this->table(['Ran?', 'Migration'], $migrations); } else { $this->error('No migrations found'); } }