migrator = $migrator;
}
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
if ( ! $this->migrator->repositoryExists())
{
return $this->error('No migrations found.');
}
$ran = $this->migrator->getRepository()->getRan();
$migrations = [];
foreach ($this->getAllMigrationFiles() as $migration)
{
$migrations[] = in_array($migration, $ran) ? ['Y', $migration] : ['N', $migration];
}
if (count($migrations) > 0)
{
$this->table(['Ran?', 'Migration'], $migrations);
}
else
{
$this->error('No migrations found');
}
}
/**
* Get all of the migration files.
*
* @return array
*/
protected function getAllMigrationFiles()
{
return $this->migrator->getMigrationFiles($this->getMigrationPath());
}
}