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('game::game.label.name'), "placeholder" => trans('game::game.placeholder.name'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'slug' => [ "type" => 'text', "label" => trans('game::game.label.slug'), "placeholder" => trans('game::game.placeholder.slug'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'thumbnail' => [ "type" => 'image', "label" => trans('game::game.label.thumbnail'), "placeholder" => trans('game::game.placeholder.thumbnail'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'html_editor', "label" => trans('game::game.label.description'), "placeholder" => trans('game::game.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('game::game.label.images'), "placeholder" => trans('game::game.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'status' => [ "type" => 'checkboxes', "label" => trans('game::game.label.status'), "placeholder" => trans('game::game.placeholder.status'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'featured' => [ "type" => 'checkboxes', "label" => trans('game::game.label.featured'), "placeholder" => trans('game::game.placeholder.featured'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'game_path' => [ "type" => 'text', "label" => trans('game::game.label.game_path'), "placeholder" => trans('game::game.placeholder.game_path'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'play_count' => [ "type" => 'numeric', "label" => trans('game::game.label.play_count'), "placeholder" => trans('game::game.placeholder.play_count'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category_id' => [ "type" => 'model_select', "label" => trans('game::game.label.category_id'), "placeholder" => trans('game::game.placeholder.category_id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }