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::task.label.project_id'), "placeholder" => trans('task::task.placeholder.project_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'module' => [ "type" => 'text', "label" => trans('task::task.label.module'), "placeholder" => trans('task::task.placeholder.module'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'work_details' => [ "type" => 'text', "label" => trans('task::task.label.work_details'), "placeholder" => trans('task::task.placeholder.work_details'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date' => [ "type" => 'date_time_picker', "label" => trans('task::task.label.date'), "placeholder" => trans('task::task.placeholder.date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_time' => [ "type" => 'time_picker', "label" => trans('task::task.label.start_time'), "placeholder" => trans('task::task.placeholder.start_time'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end_time' => [ "type" => 'time_picker', "label" => trans('task::task.label.end_time'), "placeholder" => trans('task::task.placeholder.end_time'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'document' => [ "type" => 'text', "label" => trans('task::task.label.document'), "placeholder" => trans('task::task.placeholder.document'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'text', "label" => trans('task::task.label.images'), "placeholder" => trans('task::task.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sub_task' => [ "type" => 'text', "label" => trans('task::task.label.sub_task'), "placeholder" => trans('task::task.placeholder.sub_task'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'comment' => [ "type" => 'text', "label" => trans('task::task.label.comment'), "placeholder" => trans('task::task.placeholder.comment'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tester_comment' => [ "type" => 'text', "label" => trans('task::task.label.tester_comment'), "placeholder" => trans('task::task.placeholder.tester_comment'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }