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