/**
  * @param $fieldType
  * @param $arguments
  * @return Field
  */
 public function __call($fieldType, $arguments)
 {
     $method = 'add' . Str::studly($fieldType);
     if (method_exists($this, $method)) {
         return call_user_func([$this->_form(), $method], $arguments);
     }
     return $this->_form()->addDynamicField($fieldType, $arguments);
 }
Esempio n. 2
0
 /**
  * @param $name
  * @param null $slug
  * @return \Pages\PageGroup
  */
 public function add($name, $slug = null)
 {
     $slug = $slug ?: Str::slug($name);
     $page = $this->makeGroup($name, $slug);
     return $this->addGroup($slug, $page);
 }