public function fire() { $this->comment("Preparing the seeder class for database {$this->getDatabaseName()}"); // Grab the options $ignore = $this->option('ignore'); if (empty($ignore)) { $this->handler->seed(); } else { $tables = explode(',', str_replace(' ', '', $ignore)); $this->handler->ignore($tables)->seed(); foreach (DbExporter::$ignore as $table) { $this->comment("Ignoring the {$table} table"); } } // Symfony style block messages $formatter = $this->getHelperSet()->get('formatter'); $filename = $this->getFilename(); $errorMessages = array('Success!', "Database seed class generated in: {$filename}"); $formattedBlock = $formatter->formatBlock($errorMessages, 'info', true); $this->line($formattedBlock); }
public function fire() { $database = $this->argument('database'); // Display some helpfull info if (empty($database)) { $this->comment("Preparing the migrations for database: {$this->getDatabaseName()}"); } else { $this->comment("Preparing the migrations for database {$database}"); } // Grab the options $ignore = $this->option('ignore'); if (empty($ignore)) { $this->handler->migrate($database); } else { $tables = explode(',', str_replace(' ', '', $ignore)); $this->handler->ignore($tables)->migrate($this->argument('database')); foreach (DbExporter::$ignore as $table) { $this->comment("Ignoring the {$table} table"); } } // Symfony style block messages $this->blockMessage('Success!', 'Database migrations generated in: ' . $this->handler->getMigrationsFilePath()); }