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' => [ 'name' => [ "type" => 'text', "label" => trans('product::product.label.name'), "placeholder" => trans('product::product.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'code' => [ "type" => 'text', "label" => trans('product::product.label.code'), "placeholder" => trans('product::product.placeholder.code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'select', "label" => trans('product::product.label.type'), "placeholder" => trans('product::product.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'brand' => [ "type" => 'text', "label" => trans('product::product.label.brand'), "placeholder" => trans('product::product.placeholder.brand'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'manufacturer' => [ "type" => 'text', "label" => trans('product::product.label.manufacturer'), "placeholder" => trans('product::product.placeholder.manufacturer'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'unspsc' => [ "type" => 'text', "label" => trans('product::product.label.unspsc'), "placeholder" => trans('product::product.placeholder.unspsc'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'himf' => [ "type" => 'text', "label" => trans('product::product.label.himf'), "placeholder" => trans('product::product.placeholder.himf'), "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" => [], ], ], 'uom' => [ "type" => 'text', "label" => trans('product::product.label.uom'), "placeholder" => trans('product::product.placeholder.uom'), "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" => [], ], ], 'description' => [ "type" => 'textarea', "label" => trans('product::product.label.description'), "placeholder" => trans('product::product.placeholder.description'), "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" => 'textarea', "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" => 'textarea', "label" => trans('product::product.label.meta_keyword'), "placeholder" => trans('product::product.placeholder.meta_keyword'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'image' => [ "type" => 'image', "label" => trans('product::product.label.image'), "placeholder" => trans('product::product.placeholder.image'), "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" => [], ], ], ] ); } }