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' => [ 'parent_id' => [ "type" => 'numeric', "label" => trans('okr::goal.label.parent_id'), "placeholder" => trans('okr::goal.placeholder.parent_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'department_id' => [ "type" => 'numeric', "label" => trans('okr::goal.label.department_id'), "placeholder" => trans('okr::goal.placeholder.department_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'owners' => [ "type" => 'text', "label" => trans('okr::goal.label.owners'), "placeholder" => trans('okr::goal.placeholder.owners'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'goal_type' => [ "type" => 'select', "label" => trans('okr::goal.label.goal_type'), "placeholder" => trans('okr::goal.placeholder.goal_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'select', "label" => trans('okr::goal.label.type'), "placeholder" => trans('okr::goal.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'visibility' => [ "type" => 'select', "label" => trans('okr::goal.label.visibility'), "placeholder" => trans('okr::goal.placeholder.visibility'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'goal' => [ "type" => 'text', "label" => trans('okr::goal.label.goal'), "placeholder" => trans('okr::goal.placeholder.goal'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('okr::goal.label.description'), "placeholder" => trans('okr::goal.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'goal_cycle' => [ "type" => 'text', "label" => trans('okr::goal.label.goal_cycle'), "placeholder" => trans('okr::goal.placeholder.goal_cycle'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_date' => [ "type" => 'date_picker', "label" => trans('okr::goal.label.start_date'), "placeholder" => trans('okr::goal.placeholder.start_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end_date' => [ "type" => 'date_picker', "label" => trans('okr::goal.label.end_date'), "placeholder" => trans('okr::goal.placeholder.end_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'progress' => [ "type" => 'decimal', "label" => trans('okr::goal.label.progress'), "placeholder" => trans('okr::goal.placeholder.progress'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }