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