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' => [ 'name' => [ "type" => 'text', "label" => trans('test::page.label.name'), "placeholder" => trans('test::page.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('test::page.label.title'), "placeholder" => trans('test::page.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'heading' => [ "type" => 'text', "label" => trans('test::page.label.heading'), "placeholder" => trans('test::page.placeholder.heading'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sub_heading' => [ "type" => 'text', "label" => trans('test::page.label.sub_heading'), "placeholder" => trans('test::page.placeholder.sub_heading'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'abstract' => [ "type" => 'text', "label" => trans('test::page.label.abstract'), "placeholder" => trans('test::page.placeholder.abstract'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'content' => [ "type" => 'text', "label" => trans('test::page.label.content'), "placeholder" => trans('test::page.placeholder.content'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'meta_title' => [ "type" => 'text', "label" => trans('test::page.label.meta_title'), "placeholder" => trans('test::page.placeholder.meta_title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'meta_keyword' => [ "type" => 'text', "label" => trans('test::page.label.meta_keyword'), "placeholder" => trans('test::page.placeholder.meta_keyword'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'meta_description' => [ "type" => 'text', "label" => trans('test::page.label.meta_description'), "placeholder" => trans('test::page.placeholder.meta_description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'banner' => [ "type" => 'textarea', "label" => trans('test::page.label.banner'), "placeholder" => trans('test::page.placeholder.banner'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'image', "label" => trans('test::page.label.images'), "placeholder" => trans('test::page.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'compile' => [ "type" => 'numeric', "label" => trans('test::page.label.compile'), "placeholder" => trans('test::page.placeholder.compile'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'view' => [ "type" => 'text', "label" => trans('test::page.label.view'), "placeholder" => trans('test::page.placeholder.view'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category' => [ "type" => 'text', "label" => trans('test::page.label.category'), "placeholder" => trans('test::page.placeholder.category'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'order' => [ "type" => 'numeric', "label" => trans('test::page.label.order'), "placeholder" => trans('test::page.placeholder.order'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'PRIMARY' => [ "type" => 'package::package.formcontrols.KEY', "label" => trans('test::page.label.PRIMARY'), "placeholder" => trans('test::page.placeholder.PRIMARY'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }