*/ class DatabaseResetCommand extends Command { /** * A quick description of this command. * @return string. */ public function brief(): string { return 'Rollback all database migrations'; } /** * Does the resetting. */ public function execute(): void { $repository = DB::getMigrationRepository(); $migrator = new Migrator($repository, $repository->getConnectionResolver(), new Filesystem); if (!$migrator->repositoryExists()) { $this->getLogger()->writeln("The migration repository doesn't exist!"); return; } $migrator->reset(); foreach ($migrator->getNotes() as $note) { $this->getLogger()->writeln(strip_tags($note)); } } }