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' => [ 'account_id' => [ "type" => 'numeric', "label" => trans('item::item.label.account_id'), "placeholder" => trans('item::item.placeholder.account_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category_id' => [ "type" => 'numeric', "label" => trans('item::item.label.category_id'), "placeholder" => trans('item::item.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'unit_id' => [ "type" => 'numeric', "label" => trans('item::item.label.unit_id'), "placeholder" => trans('item::item.placeholder.unit_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'html_editor', "label" => trans('item::item.label.name'), "placeholder" => trans('item::item.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('item::item.label.description'), "placeholder" => trans('item::item.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'radios', "label" => trans('item::item.label.type'), "placeholder" => trans('item::item.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sku' => [ "type" => 'text', "label" => trans('item::item.label.sku'), "placeholder" => trans('item::item.placeholder.sku'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'hsn_code' => [ "type" => 'text', "label" => trans('item::item.label.hsn_code'), "placeholder" => trans('item::item.placeholder.hsn_code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'barcode' => [ "type" => 'text', "label" => trans('item::item.label.barcode'), "placeholder" => trans('item::item.placeholder.barcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tax_preference' => [ "type" => 'radios', "label" => trans('item::item.label.tax_preference'), "placeholder" => trans('item::item.placeholder.tax_preference'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sale_info' => [ "type" => 'numeric', "label" => trans('item::item.label.sale_info'), "placeholder" => trans('item::item.placeholder.sale_info'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sale_selling_price' => [ "type" => 'decimal', "label" => trans('item::item.label.sale_selling_price'), "placeholder" => trans('item::item.placeholder.sale_selling_price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sale_account_id' => [ "type" => 'numeric', "label" => trans('item::item.label.sale_account_id'), "placeholder" => trans('item::item.placeholder.sale_account_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sale_description' => [ "type" => 'text', "label" => trans('item::item.label.sale_description'), "placeholder" => trans('item::item.placeholder.sale_description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'purchase_info' => [ "type" => 'numeric', "label" => trans('item::item.label.purchase_info'), "placeholder" => trans('item::item.placeholder.purchase_info'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'purchase_cost' => [ "type" => 'decimal', "label" => trans('item::item.label.purchase_cost'), "placeholder" => trans('item::item.placeholder.purchase_cost'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'purchase_account_id' => [ "type" => 'numeric', "label" => trans('item::item.label.purchase_account_id'), "placeholder" => trans('item::item.placeholder.purchase_account_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'purchase_desciption' => [ "type" => 'text', "label" => trans('item::item.label.purchase_desciption'), "placeholder" => trans('item::item.placeholder.purchase_desciption'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'intra_state_tax' => [ "type" => 'numeric', "label" => trans('item::item.label.intra_state_tax'), "placeholder" => trans('item::item.placeholder.intra_state_tax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'inter_state_tax' => [ "type" => 'numeric', "label" => trans('item::item.label.inter_state_tax'), "placeholder" => trans('item::item.placeholder.inter_state_tax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'track_inventory' => [ "type" => 'numeric', "label" => trans('item::item.label.track_inventory'), "placeholder" => trans('item::item.placeholder.track_inventory'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_source' => [ "type" => 'text', "label" => trans('item::item.label.created_source'), "placeholder" => trans('item::item.placeholder.created_source'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'quantity' => [ "type" => 'numeric', "label" => trans('item::item.label.quantity'), "placeholder" => trans('item::item.placeholder.quantity'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'order' => [ "type" => 'numeric', "label" => trans('item::item.label.order'), "placeholder" => trans('item::item.placeholder.order'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }