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' => [ 'category_id' => [ "type" => 'numeric', "label" => trans('deal::deal.label.category_id'), "placeholder" => trans('deal::deal.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country_id' => [ "type" => 'numeric', "label" => trans('deal::deal.label.country_id'), "placeholder" => trans('deal::deal.placeholder.country_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state_id' => [ "type" => 'numeric', "label" => trans('deal::deal.label.state_id'), "placeholder" => trans('deal::deal.placeholder.state_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city_id' => [ "type" => 'numeric', "label" => trans('deal::deal.label.city_id'), "placeholder" => trans('deal::deal.placeholder.city_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'select', "label" => trans('deal::deal.label.type'), "placeholder" => trans('deal::deal.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('deal::deal.label.title'), "placeholder" => trans('deal::deal.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tagline' => [ "type" => 'text', "label" => trans('deal::deal.label.tagline'), "placeholder" => trans('deal::deal.placeholder.tagline'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('deal::deal.label.images'), "placeholder" => trans('deal::deal.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'details_id' => [ "type" => 'numeric', "label" => trans('deal::deal.label.details_id'), "placeholder" => trans('deal::deal.placeholder.details_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'document' => [ "type" => 'text', "label" => trans('deal::deal.label.document'), "placeholder" => trans('deal::deal.placeholder.document'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'features' => [ "type" => 'text', "label" => trans('deal::deal.label.features'), "placeholder" => trans('deal::deal.placeholder.features'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'decimal', "label" => trans('deal::deal.label.price'), "placeholder" => trans('deal::deal.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'expire_date' => [ "type" => 'date_time_picker', "label" => trans('deal::deal.label.expire_date'), "placeholder" => trans('deal::deal.placeholder.expire_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'media_id' => [ "type" => 'numeric', "label" => trans('deal::deal.label.media_id'), "placeholder" => trans('deal::deal.placeholder.media_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'target_group' => [ "type" => 'text', "label" => trans('deal::deal.label.target_group'), "placeholder" => trans('deal::deal.placeholder.target_group'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'age_group' => [ "type" => 'numeric', "label" => trans('deal::deal.label.age_group'), "placeholder" => trans('deal::deal.placeholder.age_group'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('deal::deal.label.email'), "placeholder" => trans('deal::deal.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'text', "label" => trans('deal::deal.label.phone'), "placeholder" => trans('deal::deal.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'website' => [ "type" => 'text', "label" => trans('deal::deal.label.website'), "placeholder" => trans('deal::deal.placeholder.website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tags' => [ "type" => 'text', "label" => trans('deal::deal.label.tags'), "placeholder" => trans('deal::deal.placeholder.tags'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'viewcount' => [ "type" => 'numeric', "label" => trans('deal::deal.label.viewcount'), "placeholder" => trans('deal::deal.placeholder.viewcount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'status' => [ "type" => 'select', "label" => trans('deal::deal.label.status'), "placeholder" => trans('deal::deal.placeholder.status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }