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' => [ 'employee_id' => [ "type" => 'numeric', "label" => trans('employee::dependents.label.employee_id'), "placeholder" => trans('employee::dependents.placeholder.employee_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('employee::dependents.label.name'), "placeholder" => trans('employee::dependents.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'relation' => [ "type" => 'radios', "label" => trans('employee::dependents.label.relation'), "placeholder" => trans('employee::dependents.placeholder.relation'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country' => [ "type" => 'text', "label" => trans('employee::dependents.label.country'), "placeholder" => trans('employee::dependents.placeholder.country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'com_spon_visa' => [ "type" => 'numeric', "label" => trans('employee::dependents.label.com_spon_visa'), "placeholder" => trans('employee::dependents.placeholder.com_spon_visa'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'com_spon_med_ins' => [ "type" => 'numeric', "label" => trans('employee::dependents.label.com_spon_med_ins'), "placeholder" => trans('employee::dependents.placeholder.com_spon_med_ins'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }