setForm(); } /** * Return form elements. * * @return array. */ public function form($element = 'fields', $grouped = true) { $item = collect($this->form->get($element)); if ($element == 'fields' && $grouped == true) { return $item->groupBy(['group', 'section']); } return $item; } /** * Sets the form and form elements. * @return null. */ public function setForm() { $this->form = collect([ 'form' => [ 'store' => [], 'update' => [], ], 'groups' => [ 'main' => 'Main', ], 'fields' => [ 'seller_id' => [ "type" => 'text', "label" => trans('policy::policy.label.seller_id'), "placeholder" => trans('policy::policy.placeholder.seller_id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'policy_type' => [ "type" => 'radios', "label" => trans('policy::policy.label.policy_type'), "placeholder" => trans('policy::policy.placeholder.policy_type'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'content' => [ "type" => 'text', "label" => trans('policy::policy.label.content'), "placeholder" => trans('policy::policy.placeholder.content'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }