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' => [ 'item_id' => [ "type" => 'numeric', "label" => trans('adjustment::item.label.item_id'), "placeholder" => trans('adjustment::item.placeholder.item_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'quantity_available' => [ "type" => 'decimal', "label" => trans('adjustment::item.label.quantity_available'), "placeholder" => trans('adjustment::item.placeholder.quantity_available'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'quantity_onhand' => [ "type" => 'decimal', "label" => trans('adjustment::item.label.quantity_onhand'), "placeholder" => trans('adjustment::item.placeholder.quantity_onhand'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'quantity_adjusted' => [ "type" => 'decimal', "label" => trans('adjustment::item.label.quantity_adjusted'), "placeholder" => trans('adjustment::item.placeholder.quantity_adjusted'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'current_value' => [ "type" => 'decimal', "label" => trans('adjustment::item.label.current_value'), "placeholder" => trans('adjustment::item.placeholder.current_value'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'changed_value' => [ "type" => 'decimal', "label" => trans('adjustment::item.label.changed_value'), "placeholder" => trans('adjustment::item.placeholder.changed_value'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'adjusted_value' => [ "type" => 'decimal', "label" => trans('adjustment::item.label.adjusted_value'), "placeholder" => trans('adjustment::item.placeholder.adjusted_value'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }