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::leaves.label.employee_id'), "placeholder" => trans('employee::leaves.placeholder.employee_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'paid_leave' => [ "type" => 'numeric', "label" => trans('employee::leaves.label.paid_leave'), "placeholder" => trans('employee::leaves.placeholder.paid_leave'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sick_leave' => [ "type" => 'numeric', "label" => trans('employee::leaves.label.sick_leave'), "placeholder" => trans('employee::leaves.placeholder.sick_leave'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'maternity_leave' => [ "type" => 'numeric', "label" => trans('employee::leaves.label.maternity_leave'), "placeholder" => trans('employee::leaves.placeholder.maternity_leave'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'paternity_leave' => [ "type" => 'numeric', "label" => trans('employee::leaves.label.paternity_leave'), "placeholder" => trans('employee::leaves.placeholder.paternity_leave'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'unpaid_leave' => [ "type" => 'numeric', "label" => trans('employee::leaves.label.unpaid_leave'), "placeholder" => trans('employee::leaves.placeholder.unpaid_leave'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'absence' => [ "type" => 'numeric', "label" => trans('employee::leaves.label.absence'), "placeholder" => trans('employee::leaves.placeholder.absence'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }