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' => [ 'comment' => [ "type" => 'html_editor', "label" => trans('blog::comment.label.comment'), "placeholder" => trans('blog::comment.placeholder.comment'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'author' => [ "type" => 'text', "label" => trans('blog::comment.label.author'), "placeholder" => trans('blog::comment.placeholder.author'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('blog::comment.label.email'), "placeholder" => trans('blog::comment.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'mobile' => [ "type" => 'numeric', "label" => trans('blog::comment.label.mobile'), "placeholder" => trans('blog::comment.placeholder.mobile'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'published' => [ "type" => 'radios', "label" => trans('blog::comment.label.published'), "placeholder" => trans('blog::comment.placeholder.published'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'blog_id' => [ "type" => 'numeric', "label" => trans('blog::comment.label.blog_id'), "placeholder" => trans('blog::comment.placeholder.blog_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }