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' => [ 'name' => [ "type" => 'text', "label" => trans('call::call.label.name'), "placeholder" => trans('call::call.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'parent_id' => [ "type" => 'numeric', "label" => trans('call::call.label.parent_id'), "placeholder" => trans('call::call.placeholder.parent_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'customer_id' => [ "type" => 'numeric', "label" => trans('call::call.label.customer_id'), "placeholder" => trans('call::call.placeholder.customer_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'assigned_date' => [ "type" => 'date_picker', "label" => trans('call::call.label.assigned_date'), "placeholder" => trans('call::call.placeholder.assigned_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'reminder' => [ "type" => 'date_picker', "label" => trans('call::call.label.reminder'), "placeholder" => trans('call::call.placeholder.reminder'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'assigned_to' => [ "type" => 'text', "label" => trans('call::call.label.assigned_to'), "placeholder" => trans('call::call.placeholder.assigned_to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'direction' => [ "type" => 'text', "label" => trans('call::call.label.direction'), "placeholder" => trans('call::call.placeholder.direction'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'hot_call' => [ "type" => 'text', "label" => trans('call::call.label.hot_call'), "placeholder" => trans('call::call.placeholder.hot_call'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'called_on' => [ "type" => 'date_picker', "label" => trans('call::call.label.called_on'), "placeholder" => trans('call::call.placeholder.called_on'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'duration' => [ "type" => 'text', "label" => trans('call::call.label.duration'), "placeholder" => trans('call::call.placeholder.duration'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'substatus' => [ "type" => 'text', "label" => trans('call::call.label.substatus'), "placeholder" => trans('call::call.placeholder.substatus'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'notes' => [ "type" => 'text', "label" => trans('call::call.label.notes'), "placeholder" => trans('call::call.placeholder.notes'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }