/** * * * @param string $class * @return void */ public function call($class) { $this->resolve($class)->run(); if (isset($this->command)) { $this->command->getOutput()->writeln("<info>Gencrud:</info> {$class}"); } }
/** * Seed the given connection from the given path. * * @param string $class * @return void */ public function call($class) { $this->resolve($class)->__invoke(); if (isset($this->command)) { $this->command->getOutput()->writeln("<info>Seeded:</info> {$class}"); } }
/** * Seed the fixtures. */ public function seed($table) { $data = $this->yamlLoader->loadYmlData($table); if ($this->command) { $this->command->getOutput()->writeln("<info>Seeded Fixture:</info> {$table}"); } $this->process($data['settings'], $data['items']); }
/** * Print progress on an iterator * * @param array $items * @param callable $closure */ public function progressIterator($items, callable $closure) { // Normal loop if no output if (!$this->command or sizeof($items) == 1) { foreach ($items as $value) { $closure($value); } return; } $output = $this->command->getOutput(); $iterations = sizeof($items); // Create Progress helper if (class_exists('Symfony\\Component\\Console\\Helper\\ProgressBar')) { $progress = new \Symfony\Component\Console\Helper\ProgressBar($output, $iterations); $progress->start(); } else { $progress = $this->command->getHelper('progress'); $progress->start($output, $iterations); } // Loop over items foreach ($items as $value) { $progress->advance(); $closure($value, $progress); } $progress->finish(); }
/** * Seed the given connection from the given path. * * @param string $class * @return void */ public function call($class) { $this->resolve($class)->run(); $this->command->getOutput()->writeln("<info>Seeded:</info> {$class}"); }
/** * Write a done message to the output. * * @param \Illuminate\Console\Command $command * @return void */ protected function done(Command $command) { $command->getOutput()->writeln('<info>Done!</info>'); }