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('hr_request::hr_requests.label.employee_id'), "placeholder" => trans('hr_request::hr_requests.placeholder.employee_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'team_id' => [ "type" => 'numeric', "label" => trans('hr_request::hr_requests.label.team_id'), "placeholder" => trans('hr_request::hr_requests.placeholder.team_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'radios', "label" => trans('hr_request::hr_requests.label.type'), "placeholder" => trans('hr_request::hr_requests.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('hr_request::hr_requests.label.title'), "placeholder" => trans('hr_request::hr_requests.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date_from' => [ "type" => 'date_picker', "label" => trans('hr_request::hr_requests.label.date_from'), "placeholder" => trans('hr_request::hr_requests.placeholder.date_from'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date_to' => [ "type" => 'date_picker', "label" => trans('hr_request::hr_requests.label.date_to'), "placeholder" => trans('hr_request::hr_requests.placeholder.date_to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'document_type' => [ "type" => 'radios', "label" => trans('hr_request::hr_requests.label.document_type'), "placeholder" => trans('hr_request::hr_requests.placeholder.document_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'addresee' => [ "type" => 'text', "label" => trans('hr_request::hr_requests.label.addresee'), "placeholder" => trans('hr_request::hr_requests.placeholder.addresee'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'leave_type' => [ "type" => 'radios', "label" => trans('hr_request::hr_requests.label.leave_type'), "placeholder" => trans('hr_request::hr_requests.placeholder.leave_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'leave_half_day' => [ "type" => 'numeric', "label" => trans('hr_request::hr_requests.label.leave_half_day'), "placeholder" => trans('hr_request::hr_requests.placeholder.leave_half_day'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('hr_request::hr_requests.label.description'), "placeholder" => trans('hr_request::hr_requests.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'amount' => [ "type" => 'decimal', "label" => trans('hr_request::hr_requests.label.amount'), "placeholder" => trans('hr_request::hr_requests.placeholder.amount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'files' => [ "type" => 'text', "label" => trans('hr_request::hr_requests.label.files'), "placeholder" => trans('hr_request::hr_requests.placeholder.files'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }