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' => [ 'ou_id' => [ "type" => 'numeric', "label" => trans('buyer::costcenter.label.ou_id'), "placeholder" => trans('buyer::costcenter.placeholder.ou_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'coce_number' => [ "type" => 'numeric', "label" => trans('buyer::costcenter.label.coce_number'), "placeholder" => trans('buyer::costcenter.placeholder.coce_number'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'coce_budget' => [ "type" => 'decimal', "label" => trans('buyer::costcenter.label.coce_budget'), "placeholder" => trans('buyer::costcenter.placeholder.coce_budget'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'coce_name' => [ "type" => 'text', "label" => trans('buyer::costcenter.label.coce_name'), "placeholder" => trans('buyer::costcenter.placeholder.coce_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'coce_description' => [ "type" => 'text', "label" => trans('buyer::costcenter.label.coce_description'), "placeholder" => trans('buyer::costcenter.placeholder.coce_description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'coce_tag' => [ "type" => 'text', "label" => trans('buyer::costcenter.label.coce_tag'), "placeholder" => trans('buyer::costcenter.placeholder.coce_tag'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'PRIMARY' => [ "type" => 'package::package.formcontrols.KEY', "label" => trans('buyer::costcenter.label.PRIMARY'), "placeholder" => trans('buyer::costcenter.placeholder.PRIMARY'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }