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' => [ 'company_id' => [ "type" => 'numeric', "label" => trans('transferform::transferform.label.company_id'), "placeholder" => trans('transferform::transferform.placeholder.company_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'employee_id' => [ "type" => 'numeric', "label" => trans('transferform::transferform.label.employee_id'), "placeholder" => trans('transferform::transferform.placeholder.employee_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'company_type' => [ "type" => 'radios', "label" => trans('transferform::transferform.label.company_type'), "placeholder" => trans('transferform::transferform.placeholder.company_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'from_division_code' => [ "type" => 'text', "label" => trans('transferform::transferform.label.from_division_code'), "placeholder" => trans('transferform::transferform.placeholder.from_division_code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'from_gang_number' => [ "type" => 'text', "label" => trans('transferform::transferform.label.from_gang_number'), "placeholder" => trans('transferform::transferform.placeholder.from_gang_number'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'from_designation' => [ "type" => 'text', "label" => trans('transferform::transferform.label.from_designation'), "placeholder" => trans('transferform::transferform.placeholder.from_designation'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'to_division_code' => [ "type" => 'text', "label" => trans('transferform::transferform.label.to_division_code'), "placeholder" => trans('transferform::transferform.placeholder.to_division_code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'to_gang_number' => [ "type" => 'text', "label" => trans('transferform::transferform.label.to_gang_number'), "placeholder" => trans('transferform::transferform.placeholder.to_gang_number'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'to_designation' => [ "type" => 'text', "label" => trans('transferform::transferform.label.to_designation'), "placeholder" => trans('transferform::transferform.placeholder.to_designation'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'to_category' => [ "type" => 'radios', "label" => trans('transferform::transferform.label.to_category'), "placeholder" => trans('transferform::transferform.placeholder.to_category'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'purpose' => [ "type" => 'text', "label" => trans('transferform::transferform.label.purpose'), "placeholder" => trans('transferform::transferform.placeholder.purpose'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'effective_month' => [ "type" => 'date_picker', "label" => trans('transferform::transferform.label.effective_month'), "placeholder" => trans('transferform::transferform.placeholder.effective_month'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }