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('product::product.label.category_id'), "placeholder" => trans('product::product.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'seller_id' => [ "type" => 'numeric', "label" => trans('product::product.label.seller_id'), "placeholder" => trans('product::product.placeholder.seller_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sku' => [ "type" => 'text', "label" => trans('product::product.label.sku'), "placeholder" => trans('product::product.placeholder.sku'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('product::product.label.name'), "placeholder" => trans('product::product.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'numeric', "label" => trans('product::product.label.price'), "placeholder" => trans('product::product.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'temp_price' => [ "type" => 'numeric', "label" => trans('product::product.label.temp_price'), "placeholder" => trans('product::product.placeholder.temp_price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'discount' => [ "type" => 'numeric', "label" => trans('product::product.label.discount'), "placeholder" => trans('product::product.placeholder.discount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'quantity' => [ "type" => 'numeric', "label" => trans('product::product.label.quantity'), "placeholder" => trans('product::product.placeholder.quantity'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'size' => [ "type" => 'text', "label" => trans('product::product.label.size'), "placeholder" => trans('product::product.placeholder.size'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'classification' => [ "type" => 'text', "label" => trans('product::product.label.classification'), "placeholder" => trans('product::product.placeholder.classification'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'html_editor', "label" => trans('product::product.label.description'), "placeholder" => trans('product::product.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'return_policy' => [ "type" => 'html_editor', "label" => trans('product::product.label.return_policy'), "placeholder" => trans('product::product.placeholder.return_policy'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'meta_title' => [ "type" => 'text', "label" => trans('product::product.label.meta_title'), "placeholder" => trans('product::product.placeholder.meta_title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'meta_description' => [ "type" => 'html_editor', "label" => trans('product::product.label.meta_description'), "placeholder" => trans('product::product.placeholder.meta_description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'meta_keyword' => [ "type" => 'text', "label" => trans('product::product.label.meta_keyword'), "placeholder" => trans('product::product.placeholder.meta_keyword'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'featured' => [ "type" => 'numeric', "label" => trans('product::product.label.featured'), "placeholder" => trans('product::product.placeholder.featured'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'premium' => [ "type" => 'numeric', "label" => trans('product::product.label.premium'), "placeholder" => trans('product::product.placeholder.premium'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'image' => [ "type" => 'text', "label" => trans('product::product.label.image'), "placeholder" => trans('product::product.placeholder.image'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'outofstock_status' => [ "type" => 'select', "label" => trans('product::product.label.outofstock_status'), "placeholder" => trans('product::product.placeholder.outofstock_status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'order' => [ "type" => 'numeric', "label" => trans('product::product.label.order'), "placeholder" => trans('product::product.placeholder.order'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date_available' => [ "type" => 'date_time_picker', "label" => trans('product::product.label.date_available'), "placeholder" => trans('product::product.placeholder.date_available'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'text', "label" => trans('product::product.label.images'), "placeholder" => trans('product::product.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }