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' => [ 'title' => [ "type" => 'text', "label" => trans('good_to__know::news.label.title'), "placeholder" => trans('good_to__know::news.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'subtitle' => [ "type" => 'text', "label" => trans('good_to__know::news.label.subtitle'), "placeholder" => trans('good_to__know::news.placeholder.subtitle'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category_id' => [ "type" => 'numeric', "label" => trans('good_to__know::news.label.category_id'), "placeholder" => trans('good_to__know::news.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'website' => [ "type" => 'text', "label" => trans('good_to__know::news.label.website'), "placeholder" => trans('good_to__know::news.placeholder.website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'video' => [ "type" => 'text', "label" => trans('good_to__know::news.label.video'), "placeholder" => trans('good_to__know::news.placeholder.video'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tags' => [ "type" => 'text', "label" => trans('good_to__know::news.label.tags'), "placeholder" => trans('good_to__know::news.placeholder.tags'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'brand_id' => [ "type" => 'numeric', "label" => trans('good_to__know::news.label.brand_id'), "placeholder" => trans('good_to__know::news.placeholder.brand_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'media_id' => [ "type" => 'numeric', "label" => trans('good_to__know::news.label.media_id'), "placeholder" => trans('good_to__know::news.placeholder.media_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'media_type' => [ "type" => 'text', "label" => trans('good_to__know::news.label.media_type'), "placeholder" => trans('good_to__know::news.placeholder.media_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'file' => [ "type" => 'text', "label" => trans('good_to__know::news.label.file'), "placeholder" => trans('good_to__know::news.placeholder.file'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'content' => [ "type" => 'text', "label" => trans('good_to__know::news.label.content'), "placeholder" => trans('good_to__know::news.placeholder.content'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'good_to_know' => [ "type" => 'select', "label" => trans('good_to__know::news.label.good_to_know'), "placeholder" => trans('good_to__know::news.placeholder.good_to_know'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('good_to__know::news.label.images'), "placeholder" => trans('good_to__know::news.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }