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' => [ 'sender_id' => [ "type" => 'numeric', "label" => trans('chat::chat.label.sender_id'), "placeholder" => trans('chat::chat.placeholder.sender_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'receiver_id' => [ "type" => 'numeric', "label" => trans('chat::chat.label.receiver_id'), "placeholder" => trans('chat::chat.placeholder.receiver_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'product_id' => [ "type" => 'numeric', "label" => trans('chat::chat.label.product_id'), "placeholder" => trans('chat::chat.placeholder.product_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }