/** * Get template replacements. * * @return array */ public function getReplacements() { $replacements = array_merge(parent::getReplacements(), ['root_namespace' => $this->getAppNamespace()]); if ($this->scaffold) { return array_merge($replacements, $this->scaffolder->toArray()); } return $replacements; }
/** * Get array replacements. * * @return array */ public function getReplacements() { return array_merge(parent::getReplacements(), ['fillable' => $this->getFillable()]); }
/** * Get stub templates. * * @return string */ public function getStub() { $parser = $this->getNameParser(); if ($parser->isCreate()) { return Stub::create('/migration/create.stub', ['class' => $this->getClass(), 'table' => $parser->getTable(), 'fields' => $this->getSchemaParser()->render()]); } elseif ($parser->isAdd()) { return Stub::create('/migration/add.stub', ['class' => $this->getClass(), 'table' => $parser->getTable(), 'fields_up' => $this->getSchemaParser()->up(), 'fields_down' => $this->getSchemaParser()->down()]); } elseif ($parser->isDelete()) { return Stub::create('/migration/delete.stub', ['class' => $this->getClass(), 'table' => $parser->getTable(), 'fields_down' => $this->getSchemaParser()->up(), 'fields_up' => $this->getSchemaParser()->down()]); } elseif ($parser->isDrop()) { return Stub::create('/migration/drop.stub', ['class' => $this->getClass(), 'table' => $parser->getTable(), 'fields' => $this->getSchemaParser()->render()]); } return parent::getStub(); }
/** * Get stub replacements. * * @return array */ public function getReplacements() { return array_merge(parent::getReplacements(), ['auth' => $this->getAuth(), 'rules' => $this->getRules()]); }
/** * Get stub replacements. * * @return array */ public function getReplacements() { return array_merge(parent::getReplacements(), ['table_one' => $this->table_one, 'table_two' => $this->table_two, 'column_one' => $this->getColumnOne(), 'column_two' => $this->getColumnTwo(), 'table_pivot' => $this->getPivotTableName(), 'timestamp' => $this->getTimestampReplacement()]); }