/**
  * Create and return a Field Instance.
  * 
  * @param mixed  $type
  * @param string $name
  * @param string $value
  * @param mixed  $inner
  * 
  * @return 
  */
 private function createField($type, $name, $value, $inner)
 {
     if ($this->hasOptionsMethod($name)) {
         $inner = array_merge($inner, ['options' => $this->getOptions($name)]);
     }
     return $this->fields->create($type, $name, $this->getValue($name), $inner);
 }
Example #2
0
 /**
  * Set the available fields.
  *
  * @return void
  */
 public function setFields()
 {
     $this->fields = collect();
     foreach ($this->options as $key => $option) {
         if (!isset($option['type'])) {
             continue;
         }
         $this->fields->put($this->key() . '.' . $key, $this->fieldManager->create($option['type'], $key, $this->getValue($key), $option));
     }
 }