| @@ 86-96 (lines=11) @@ | ||
| 83 | ||
| 84 | public function getNodes() |
|
| 85 | { |
|
| 86 | if ($this->nodes instanceof \Closure) { |
|
| 87 | $nodes = ($this->nodes)(); |
|
| 88 | } elseif (is_string($this->nodes) || $this->nodes instanceof Model) { |
|
| 89 | $nodes = $this->setNodesFromModel(); |
|
| 90 | } elseif (is_array($this->nodes)) { |
|
| 91 | $nodes = $this->nodes; |
|
| 92 | } else { |
|
| 93 | throw new InvalidArgumentException( |
|
| 94 | "The form tree element's nodes must be return array" |
|
| 95 | ); |
|
| 96 | } |
|
| 97 | ||
| 98 | return $nodes; |
|
| 99 | } |
|
| @@ 78-88 (lines=11) @@ | ||
| 75 | ||
| 76 | public function getOptions() |
|
| 77 | { |
|
| 78 | if ($this->options instanceof \Closure) { |
|
| 79 | $options = ($this->options)(); |
|
| 80 | } elseif (is_string($this->options) || $this->options instanceof Model) { |
|
| 81 | $options = $this->setOptionsFromModel(); |
|
| 82 | } elseif (is_array($this->options)) { |
|
| 83 | $options = $this->options; |
|
| 84 | } else { |
|
| 85 | throw new InvalidArgumentException( |
|
| 86 | "The form select element's options must be return array(key=>value)" |
|
| 87 | ); |
|
| 88 | } |
|
| 89 | ||
| 90 | //$options = collect($options)->merge(); |
|
| 91 | ||