callback = $callback; $this->form = $form; call_user_func($this->callback, $this); } /** * Get fields of this row. * * @return array */ public function fields() { return $this->fields; } /** * Set width for a incomming field. * * @param int $width * * @return $this */ public function width($width = 12) { $this->defaultFieldWidth = $width; return $this; } /** * Render the row. * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function render() { return view('admin::form.row', ['fields' => $this->fields]); } /** * Add field. * * @param string $method * @param array $arguments * * @return Field|void */ public function __call($method, $arguments) { $field = $this->form->__call($method, $arguments); $field->disableHorizontal(); $this->fields[] = [ 'width' => $this->defaultFieldWidth, 'element' => $field, ]; return $field; } }