function getForm() { $form = new LaraForm($this->relation); $form->putTbHidden('relation')->setValue($this->relation); $method = \Str::camel('relation_' . $this->relation); $model = call_user_func([$this, $method]); $options = $model::orderBy($this->orderByModel())->listsExt(); if (!is_array($options)) { $options = []; } $method = \Str::camel('empty_' . $this->relation); if (method_exists($this, $method)) { $empty = call_user_func([$this, $method]); $options = [0 => $empty] + $options; } $form->putTbGroupRadio('belongs_to', $options, false); $ids = $this->ids(); $form->initValues(['belongs_to' => $ids]); return $form; }