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('education::deal.label.category_id'), "placeholder" => trans('education::deal.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country_id' => [ "type" => 'numeric', "label" => trans('education::deal.label.country_id'), "placeholder" => trans('education::deal.placeholder.country_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state_id' => [ "type" => 'numeric', "label" => trans('education::deal.label.state_id'), "placeholder" => trans('education::deal.placeholder.state_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city_id' => [ "type" => 'numeric', "label" => trans('education::deal.label.city_id'), "placeholder" => trans('education::deal.placeholder.city_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'select', "label" => trans('education::deal.label.type'), "placeholder" => trans('education::deal.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type_id' => [ "type" => 'numeric', "label" => trans('education::deal.label.type_id'), "placeholder" => trans('education::deal.placeholder.type_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('education::deal.label.title'), "placeholder" => trans('education::deal.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('education::deal.label.images'), "placeholder" => trans('education::deal.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('education::deal.label.description'), "placeholder" => trans('education::deal.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'features' => [ "type" => 'text', "label" => trans('education::deal.label.features'), "placeholder" => trans('education::deal.placeholder.features'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'decimal', "label" => trans('education::deal.label.price'), "placeholder" => trans('education::deal.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'expire_date' => [ "type" => 'date_picker', "label" => trans('education::deal.label.expire_date'), "placeholder" => trans('education::deal.placeholder.expire_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'media_id' => [ "type" => 'numeric', "label" => trans('education::deal.label.media_id'), "placeholder" => trans('education::deal.placeholder.media_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'target_group' => [ "type" => 'text', "label" => trans('education::deal.label.target_group'), "placeholder" => trans('education::deal.placeholder.target_group'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'age_group' => [ "type" => 'text', "label" => trans('education::deal.label.age_group'), "placeholder" => trans('education::deal.placeholder.age_group'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'topics' => [ "type" => 'numeric', "label" => trans('education::deal.label.topics'), "placeholder" => trans('education::deal.placeholder.topics'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'brands' => [ "type" => 'numeric', "label" => trans('education::deal.label.brands'), "placeholder" => trans('education::deal.placeholder.brands'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tags' => [ "type" => 'text', "label" => trans('education::deal.label.tags'), "placeholder" => trans('education::deal.placeholder.tags'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'is_deal' => [ "type" => 'select', "label" => trans('education::deal.label.is_deal'), "placeholder" => trans('education::deal.placeholder.is_deal'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'discount' => [ "type" => 'numeric', "label" => trans('education::deal.label.discount'), "placeholder" => trans('education::deal.placeholder.discount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'discount_price' => [ "type" => 'decimal', "label" => trans('education::deal.label.discount_price'), "placeholder" => trans('education::deal.placeholder.discount_price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'conditions' => [ "type" => 'text', "label" => trans('education::deal.label.conditions'), "placeholder" => trans('education::deal.placeholder.conditions'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'valid_from' => [ "type" => 'date_picker', "label" => trans('education::deal.label.valid_from'), "placeholder" => trans('education::deal.placeholder.valid_from'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'valid_to' => [ "type" => 'date_picker', "label" => trans('education::deal.label.valid_to'), "placeholder" => trans('education::deal.placeholder.valid_to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'publish_from' => [ "type" => 'date_picker', "label" => trans('education::deal.label.publish_from'), "placeholder" => trans('education::deal.placeholder.publish_from'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'publish_to' => [ "type" => 'date_picker', "label" => trans('education::deal.label.publish_to'), "placeholder" => trans('education::deal.placeholder.publish_to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }