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' => [ 'from' => [ "type" => 'decimal', "label" => trans('employee::tax.label.from'), "placeholder" => trans('employee::tax.placeholder.from'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'to' => [ "type" => 'decimal', "label" => trans('employee::tax.label.to'), "placeholder" => trans('employee::tax.placeholder.to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nd' => [ "type" => 'decimal', "label" => trans('employee::tax.label.nd'), "placeholder" => trans('employee::tax.placeholder.nd'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dd0' => [ "type" => 'decimal', "label" => trans('employee::tax.label.dd0'), "placeholder" => trans('employee::tax.placeholder.dd0'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dd1' => [ "type" => 'decimal', "label" => trans('employee::tax.label.dd1'), "placeholder" => trans('employee::tax.placeholder.dd1'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dd2' => [ "type" => 'decimal', "label" => trans('employee::tax.label.dd2'), "placeholder" => trans('employee::tax.placeholder.dd2'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dd3_and_above' => [ "type" => 'decimal', "label" => trans('employee::tax.label.dd3_and_above'), "placeholder" => trans('employee::tax.placeholder.dd3_and_above'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }