/** * Rolls all of the currently applied migrations back. * * @param bool $pretend * @return int */ public function reset($pretend = false) { $this->notes = []; $migrations = array_reverse($this->repository->getRan()); $count = count($migrations); if ($count === 0) { $this->note('<info>Nothing to rollback.</info>'); } else { foreach ($migrations as $migration) { $this->runDown((object) ['migration' => $migration], $pretend); } } return $count; }