public function run($argumentData, $optionData) { $configName = $argumentData->get('config', 'default'); $seeder = $this->builder->seeder($configName); $output = $this->builder->cliOutput($this->cliContext()); try { $seeder->seed($output, $optionData->get('truncate', false)); } catch (\Exception $e) { throw new CommandException($e->getMessage()); } $this->writeLine("Seed data successfully inserted."); }
public function run($argumentData, $optionData) { $configName = $argumentData->get('config', 'default'); $migrator = $this->builder->migrator($configName); $output = $this->builder->cliOutput($this->cliContext()); try { $executed = $migrator->migrate($output); } catch (\Exception $e) { throw new CommandException($e->getMessage()); } if (empty($executed)) { $this->writeLine("Already on latest version."); return; } $count = count($executed); $this->writeLine("Applied {$count} migration(s)"); }