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' => [ 'name' => [ "type" => 'text', "label" => trans('financial_plan::plan.label.name'), "placeholder" => trans('financial_plan::plan.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'no_of_year' => [ "type" => 'numeric', "label" => trans('financial_plan::plan.label.no_of_year'), "placeholder" => trans('financial_plan::plan.placeholder.no_of_year'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_date' => [ "type" => 'date_picker', "label" => trans('financial_plan::plan.label.start_date'), "placeholder" => trans('financial_plan::plan.placeholder.start_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_year' => [ "type" => 'select', "label" => trans('financial_plan::plan.label.start_year'), "placeholder" => trans('financial_plan::plan.placeholder.start_year'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'slack' => [ "type" => 'numeric', "label" => trans('financial_plan::plan.label.slack'), "placeholder" => trans('financial_plan::plan.placeholder.slack'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'cpi' => [ "type" => 'numeric', "label" => trans('financial_plan::plan.label.cpi'), "placeholder" => trans('financial_plan::plan.placeholder.cpi'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'priority' => [ "type" => 'text', "label" => trans('financial_plan::plan.label.priority'), "placeholder" => trans('financial_plan::plan.placeholder.priority'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }