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('manpower::manpower.label.company_id'), "placeholder" => trans('manpower::manpower.placeholder.company_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'company_type' => [ "type" => 'radios', "label" => trans('manpower::manpower.label.company_type'), "placeholder" => trans('manpower::manpower.placeholder.company_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'department_id' => [ "type" => 'numeric', "label" => trans('manpower::manpower.label.department_id'), "placeholder" => trans('manpower::manpower.placeholder.department_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date' => [ "type" => 'date', "label" => trans('manpower::manpower.label.date'), "placeholder" => trans('manpower::manpower.placeholder.date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'job_vacancy' => [ "type" => 'text', "label" => trans('manpower::manpower.label.job_vacancy'), "placeholder" => trans('manpower::manpower.placeholder.job_vacancy'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'location' => [ "type" => 'text', "label" => trans('manpower::manpower.label.location'), "placeholder" => trans('manpower::manpower.placeholder.location'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'employed_under' => [ "type" => 'text', "label" => trans('manpower::manpower.label.employed_under'), "placeholder" => trans('manpower::manpower.placeholder.employed_under'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'reason' => [ "type" => 'text', "label" => trans('manpower::manpower.label.reason'), "placeholder" => trans('manpower::manpower.placeholder.reason'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'radios', "label" => trans('manpower::manpower.label.type'), "placeholder" => trans('manpower::manpower.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'employment_type' => [ "type" => 'radios', "label" => trans('manpower::manpower.label.employment_type'), "placeholder" => trans('manpower::manpower.placeholder.employment_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'others_reason' => [ "type" => 'text', "label" => trans('manpower::manpower.label.others_reason'), "placeholder" => trans('manpower::manpower.placeholder.others_reason'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'work_description' => [ "type" => 'text', "label" => trans('manpower::manpower.label.work_description'), "placeholder" => trans('manpower::manpower.placeholder.work_description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'qualification' => [ "type" => 'text', "label" => trans('manpower::manpower.label.qualification'), "placeholder" => trans('manpower::manpower.placeholder.qualification'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'work_experience' => [ "type" => 'text', "label" => trans('manpower::manpower.label.work_experience'), "placeholder" => trans('manpower::manpower.placeholder.work_experience'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'commencement_date' => [ "type" => 'date_picker', "label" => trans('manpower::manpower.label.commencement_date'), "placeholder" => trans('manpower::manpower.placeholder.commencement_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'supervisor' => [ "type" => 'text', "label" => trans('manpower::manpower.label.supervisor'), "placeholder" => trans('manpower::manpower.placeholder.supervisor'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'actual_no' => [ "type" => 'numeric', "label" => trans('manpower::manpower.label.actual_no'), "placeholder" => trans('manpower::manpower.placeholder.actual_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'plan_no' => [ "type" => 'numeric', "label" => trans('manpower::manpower.label.plan_no'), "placeholder" => trans('manpower::manpower.placeholder.plan_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'variance' => [ "type" => 'numeric', "label" => trans('manpower::manpower.label.variance'), "placeholder" => trans('manpower::manpower.placeholder.variance'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }