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