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' => [ 'client_id' => [ "type" => 'numeric', "label" => trans('pm::worklog.label.client_id'), "placeholder" => trans('pm::worklog.placeholder.client_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'project_id' => [ "type" => 'numeric', "label" => trans('pm::worklog.label.project_id'), "placeholder" => trans('pm::worklog.placeholder.project_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'task_id' => [ "type" => 'numeric', "label" => trans('pm::worklog.label.task_id'), "placeholder" => trans('pm::worklog.placeholder.task_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'started_at' => [ "type" => 'date_time_picker', "label" => trans('pm::worklog.label.started_at'), "placeholder" => trans('pm::worklog.placeholder.started_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'ended_at' => [ "type" => 'date_time_picker', "label" => trans('pm::worklog.label.ended_at'), "placeholder" => trans('pm::worklog.placeholder.ended_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'duration' => [ "type" => 'time_picker', "label" => trans('pm::worklog.label.duration'), "placeholder" => trans('pm::worklog.placeholder.duration'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('pm::worklog.label.description'), "placeholder" => trans('pm::worklog.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billable' => [ "type" => 'numeric', "label" => trans('pm::worklog.label.billable'), "placeholder" => trans('pm::worklog.placeholder.billable'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'numeric', "label" => trans('pm::worklog.label.created_by'), "placeholder" => trans('pm::worklog.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ')' => [ "type" => 'package::package.formcontrols.ON', "label" => trans('pm::worklog.label.)'), "placeholder" => trans('pm::worklog.placeholder.)'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }