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('employee::leavepay.label.company_id'), "placeholder" => trans('employee::leavepay.placeholder.company_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'department_id' => [ "type" => 'numeric', "label" => trans('employee::leavepay.label.department_id'), "placeholder" => trans('employee::leavepay.placeholder.department_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'gang_id' => [ "type" => 'numeric', "label" => trans('employee::leavepay.label.gang_id'), "placeholder" => trans('employee::leavepay.placeholder.gang_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'employee_id' => [ "type" => 'numeric', "label" => trans('employee::leavepay.label.employee_id'), "placeholder" => trans('employee::leavepay.placeholder.employee_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'radios', "label" => trans('employee::leavepay.label.type'), "placeholder" => trans('employee::leavepay.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'doj' => [ "type" => 'date_picker', "label" => trans('employee::leavepay.label.doj'), "placeholder" => trans('employee::leavepay.placeholder.doj'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'resigning' => [ "type" => 'text', "label" => trans('employee::leavepay.label.resigning'), "placeholder" => trans('employee::leavepay.placeholder.resigning'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'eligible_leave' => [ "type" => 'numeric', "label" => trans('employee::leavepay.label.eligible_leave'), "placeholder" => trans('employee::leavepay.placeholder.eligible_leave'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'basic_rate' => [ "type" => 'decimal', "label" => trans('employee::leavepay.label.basic_rate'), "placeholder" => trans('employee::leavepay.placeholder.basic_rate'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'from' => [ "type" => 'date_picker', "label" => trans('employee::leavepay.label.from'), "placeholder" => trans('employee::leavepay.placeholder.from'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'to' => [ "type" => 'date_picker', "label" => trans('employee::leavepay.label.to'), "placeholder" => trans('employee::leavepay.placeholder.to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total_leave' => [ "type" => 'numeric', "label" => trans('employee::leavepay.label.total_leave'), "placeholder" => trans('employee::leavepay.placeholder.total_leave'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total_hours' => [ "type" => 'numeric', "label" => trans('employee::leavepay.label.total_hours'), "placeholder" => trans('employee::leavepay.placeholder.total_hours'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'allowance' => [ "type" => 'decimal', "label" => trans('employee::leavepay.label.allowance'), "placeholder" => trans('employee::leavepay.placeholder.allowance'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'gross_wage' => [ "type" => 'decimal', "label" => trans('employee::leavepay.label.gross_wage'), "placeholder" => trans('employee::leavepay.placeholder.gross_wage'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'leave_tax' => [ "type" => 'decimal', "label" => trans('employee::leavepay.label.leave_tax'), "placeholder" => trans('employee::leavepay.placeholder.leave_tax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fortnight_tax' => [ "type" => 'decimal', "label" => trans('employee::leavepay.label.fortnight_tax'), "placeholder" => trans('employee::leavepay.placeholder.fortnight_tax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'net_pay' => [ "type" => 'decimal', "label" => trans('employee::leavepay.label.net_pay'), "placeholder" => trans('employee::leavepay.placeholder.net_pay'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }