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' => [ 'commentable_id' => [ "type" => 'numeric', "label" => trans('pm::comment.label.commentable_id'), "placeholder" => trans('pm::comment.placeholder.commentable_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'commentable_type' => [ "type" => 'text', "label" => trans('pm::comment.label.commentable_type'), "placeholder" => trans('pm::comment.placeholder.commentable_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'comments' => [ "type" => 'text', "label" => trans('pm::comment.label.comments'), "placeholder" => trans('pm::comment.placeholder.comments'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'files' => [ "type" => 'text', "label" => trans('pm::comment.label.files'), "placeholder" => trans('pm::comment.placeholder.files'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'numeric', "label" => trans('pm::comment.label.created_by'), "placeholder" => trans('pm::comment.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }