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' => [ 'project_id' => [ "type" => 'numeric', "label" => trans('task::tasktype.label.project_id'), "placeholder" => trans('task::tasktype.placeholder.project_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('task::tasktype.label.name'), "placeholder" => trans('task::tasktype.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'icon' => [ "type" => 'text', "label" => trans('task::tasktype.label.icon'), "placeholder" => trans('task::tasktype.placeholder.icon'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'color' => [ "type" => 'text', "label" => trans('task::tasktype.label.color'), "placeholder" => trans('task::tasktype.placeholder.color'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'details' => [ "type" => 'text', "label" => trans('task::tasktype.label.details'), "placeholder" => trans('task::tasktype.placeholder.details'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fields' => [ "type" => 'text', "label" => trans('task::tasktype.label.fields'), "placeholder" => trans('task::tasktype.placeholder.fields'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'numeric', "label" => trans('task::tasktype.label.created_by'), "placeholder" => trans('task::tasktype.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }