protected function reset(Repository $repository)
    {
        $this->migrator->setconnection($this->input->getOption('database'));

        $migrationPaths = $this->getMigrationPaths($repository);
        $files = $this->migrator->setOutput($this->output)->getMigrationFiles($migrationPaths);

        $migrations = array_reverse($this->migrator->getRepository()->getRan());

        if (count($migrations) == 0) {
            $this->output->writeln("Nothing to rollback.");
        } else {
            $this->migrator->requireFiles($files);

            foreach ($migrations as $migration) {
                if (! array_key_exists($migration, $files)) {
                    continue;
                }

                $this->runDown($files[$migration], (object) ["migration" => $migration]);
            }
        }
    }
protected function reset(Repository $repository)
    {
        $this->migrator->setconnection($this->input->getOption('database'));

        $migrationPaths = $this->getMigrationPaths($repository);
        $files = $this->migrator->setOutput($this->output)->getMigrationFiles($migrationPaths);

        $migrations = array_reverse($this->migrator->getRepository()->getRan());

        if (count($migrations) == 0) {
            $this->output->writeln("Nothing to rollback.");
        } else {
            $this->migrator->requireFiles($files);

            foreach ($migrations as $migration) {
                if (! array_key_exists($migration, $files)) {
                    continue;
                }

                $this->runDown($files[$migration], (object) ["migration" => $migration]);
            }
        }
    }
protected function reset ( Repository $ repository ) { $ this -> migrator -> setconnection ( $ this -> input -> getOption ( 'database' ) ) ; $ migrationPaths = $ this -> getMigrationPaths ( $ repository ) ; $ files = $ this -> migrator -> setOutput ( $ this -> output ) -> getMigrationFiles ( $ migrationPaths ) ; $ migrations = array_reverse ( $ this -> migrator -> getRepository ( ) -> getRan ( ) ) ; if ( count ( $ migrations ) == 0 ) { $ this -> output -> writeln ( "Nothing to rollback." ) ; } else { $ this -> migrator -> requireFiles ( $ files ) ; foreach ( $ migrations as $ migration ) { if ( ! array_key_exists ( $ migration , $ files ) ) { continue ; } $ this -> runDown ( $ files [ $ migration ] , ( object ) [ "migration" => $ migration ] ) ; } } }
Run the migration reset for the current list of slugs.

Migrations should be reset in the reverse order that they were
migrated up as. This ensures the database is properly reversed
without conflict.

@param \Caffeinated\Modules\Repositories\Repository $repository

@return mixed
Run the migration reset for the current list of slugs .