Nwidart\Modules\Commands\MigrateRollbackCommand::rollback PHP Method

rollback() public method

Rollback migration from the specified module.
public rollback ( $module )
$module
    public function rollback($module)
    {
        if (is_string($module)) {
            $module = $this->module->findOrFail($module);
        }
        $migrator = new Migrator($module);
        $database = $this->option('database');
        if (!empty($database)) {
            $migrator->setDatabase($database);
        }
        $migrated = $migrator->rollback();
        if (count($migrated)) {
            foreach ($migrated as $migration) {
                $this->line("Rollback: <info>{$migration}</info>");
            }
            return;
        }
        $this->comment('Nothing to rollback.');
    }