/**
  * Get template replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     $replacements = parent::getReplacements();
     if ($this->scaffold || $this->repository) {
         return array_merge($replacements, $this->scaffolder->toArray());
     }
     return $replacements;
 }
 /**
  * Get stub templates.
  *
  * @return string
  */
 public function getStub()
 {
     if ($this->action == 'create') {
         return Stub::createFromPath(__DIR__ . '/../Stubs/migration/create.stub', ['class' => $this->getClass(), 'table' => $this->table->getName(), 'fields' => $this->constructSchema()]);
     } elseif ($this->action == 'create_simple') {
         return Stub::createFromPath(__DIR__ . '/../Stubs/migration/create_simple.stub', ['class' => $this->getClass(), 'table' => $this->table->getName(), 'fields' => $this->constructSchema()]);
     } elseif ($this->action == 'add') {
         return Stub::createFromPath(__DIR__ . '/../Stubs/migration/add.stub', ['class' => $this->getClass(), 'table' => $this->table->getName(), 'fields_up' => $this->constructSchema(), 'fields_down' => $this->constructSchema('drop')]);
     } elseif ($this->action == 'delete') {
         return Stub::createFromPath(__DIR__ . '/../Stubs/migration/delete.stub', ['class' => $this->getClass(), 'table' => $this->table->getName(), 'fields_down' => $this->constructSchema(), 'fields_up' => $this->constructSchema('drop')]);
     } elseif ($this->action == 'drop') {
         return Stub::createFromPath(__DIR__ . '/../Stubs/migration/drop.stub', ['class' => $this->getClass(), 'table' => $this->table->getName(), 'fields' => $this->constructSchema()]);
     }
     return parent::getStub();
 }
Example #3
0
 /**
  * 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()]);
 }
Example #4
0
 /**
  * Get array replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), ['fillable' => $this->getFillable(), 'table_name' => $this->getTableName(), 'relations' => '', 'rules' => $this->getFieldRules()]);
 }
Example #5
0
 /**
  * Get array replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), ['translations' => $this->getTranslations()]);
 }
 /**
  * Get stub replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), ['auth' => $this->getAuth(), 'rules' => $this->getRules()]);
 }
 /**
  * Get array replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), (new ParameterScaffolder($this->getName(), null, 'repository'))->toArray());
 }
Example #8
0
 /**
  * Get array replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), ['fields' => $this->render()]);
 }