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' => [ 'user_id' => [ "type" => 'numeric', "label" => trans('deal::medium.label.user_id'), "placeholder" => trans('deal::medium.placeholder.user_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('deal::medium.label.name'), "placeholder" => trans('deal::medium.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tagline' => [ "type" => 'text', "label" => trans('deal::medium.label.tagline'), "placeholder" => trans('deal::medium.placeholder.tagline'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'media_type' => [ "type" => 'text', "label" => trans('deal::medium.label.media_type'), "placeholder" => trans('deal::medium.placeholder.media_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('deal::medium.label.description'), "placeholder" => trans('deal::medium.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('deal::medium.label.images'), "placeholder" => trans('deal::medium.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'upload' => [ "type" => 'files', "label" => trans('deal::medium.label.upload'), "placeholder" => trans('deal::medium.placeholder.upload'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'format' => [ "type" => 'text', "label" => trans('deal::medium.label.format'), "placeholder" => trans('deal::medium.placeholder.format'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'targetgroup' => [ "type" => 'text', "label" => trans('deal::medium.label.targetgroup'), "placeholder" => trans('deal::medium.placeholder.targetgroup'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'details' => [ "type" => 'text', "label" => trans('deal::medium.label.details'), "placeholder" => trans('deal::medium.placeholder.details'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'status' => [ "type" => 'select', "label" => trans('deal::medium.label.status'), "placeholder" => trans('deal::medium.placeholder.status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }