Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * 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();
 }
Ejemplo n.º 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()]);
 }
Ejemplo n.º 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()]);
 }
Ejemplo n.º 5
0
 /**
  * Get array replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), ['translations' => $this->getTranslations()]);
 }
Ejemplo n.º 6
0
 /**
  * Get stub replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), ['auth' => $this->getAuth(), 'rules' => $this->getRules()]);
 }
Ejemplo n.º 7
0
 /**
  * Get array replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), (new ParameterScaffolder($this->getName(), null, 'repository'))->toArray());
 }
Ejemplo n.º 8
0
 /**
  * Get array replacements.
  *
  * @return array
  */
 public function getReplacements()
 {
     return array_merge(parent::getReplacements(), ['fields' => $this->render()]);
 }