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' => [ 'lead_id' => [ "type" => 'numeric', "label" => trans('chat::chat.label.lead_id'), "placeholder" => trans('chat::chat.placeholder.lead_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'channel' => [ "type" => 'radios', "label" => trans('chat::chat.label.channel'), "placeholder" => trans('chat::chat.placeholder.channel'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'radios', "label" => trans('chat::chat.label.type'), "placeholder" => trans('chat::chat.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'message' => [ "type" => 'text', "label" => trans('chat::chat.label.message'), "placeholder" => trans('chat::chat.placeholder.message'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'file_url' => [ "type" => 'text', "label" => trans('chat::chat.label.file_url'), "placeholder" => trans('chat::chat.placeholder.file_url'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }