public function fire() { $this->generator->setOptions($this->option()); $tables = $this->sortDesiredTables(); $this->call('generate:migration', array_merge(parent::commonOptions(array()), array('name' => "pivot_{$tables[0]}_{$tables[1]}_table", '--fields' => implode(', ', array("{$tables[0]}_id:integer:unsigned:index", "{$tables[1]}_id:integer:unsigned:index", "{$tables[0]}_id:foreign:references('id'):on('" . str_plural($tables[0]) . "'):onDelete('cascade')", "{$tables[1]}_id:foreign:references('id'):on('" . str_plural($tables[1]) . "'):onDelete('cascade')"))))); }
protected function generateSeed() { $this->call('generate:seed', parent::commonOptions(array('name' => Pluralizer::plural(strtolower(substr($this->model, 0, 1)) . substr($this->model, 1))))); }