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('task::task.label.parent_id'), "placeholder" => trans('task::task.placeholder.parent_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'project_id' => [ "type" => 'numeric', "label" => trans('task::task.label.project_id'), "placeholder" => trans('task::task.placeholder.project_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sprint_id' => [ "type" => 'numeric', "label" => trans('task::task.label.sprint_id'), "placeholder" => trans('task::task.placeholder.sprint_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tasktype_id' => [ "type" => 'numeric', "label" => trans('task::task.label.tasktype_id'), "placeholder" => trans('task::task.placeholder.tasktype_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'roadmap_id' => [ "type" => 'numeric', "label" => trans('task::task.label.roadmap_id'), "placeholder" => trans('task::task.placeholder.roadmap_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'assignee_id' => [ "type" => 'numeric', "label" => trans('task::task.label.assignee_id'), "placeholder" => trans('task::task.placeholder.assignee_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'reporter_id' => [ "type" => 'numeric', "label" => trans('task::task.label.reporter_id'), "placeholder" => trans('task::task.placeholder.reporter_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'stage' => [ "type" => 'text', "label" => trans('task::task.label.stage'), "placeholder" => trans('task::task.placeholder.stage'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start' => [ "type" => 'date_time_picker', "label" => trans('task::task.label.start'), "placeholder" => trans('task::task.placeholder.start'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end' => [ "type" => 'date_time_picker', "label" => trans('task::task.label.end'), "placeholder" => trans('task::task.placeholder.end'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'task' => [ "type" => 'text', "label" => trans('task::task.label.task'), "placeholder" => trans('task::task.placeholder.task'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'estimate' => [ "type" => 'time_picker', "label" => trans('task::task.label.estimate'), "placeholder" => trans('task::task.placeholder.estimate'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'actual' => [ "type" => 'time_picker', "label" => trans('task::task.label.actual'), "placeholder" => trans('task::task.placeholder.actual'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'priority' => [ "type" => 'select', "label" => trans('task::task.label.priority'), "placeholder" => trans('task::task.placeholder.priority'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'labels' => [ "type" => 'text', "label" => trans('task::task.label.labels'), "placeholder" => trans('task::task.placeholder.labels'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billable' => [ "type" => 'numeric', "label" => trans('task::task.label.billable'), "placeholder" => trans('task::task.placeholder.billable'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'numeric', "label" => trans('task::task.label.created_by'), "placeholder" => trans('task::task.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }