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' => [ 'invoice_id' => [ "type" => 'numeric', "label" => trans('account::invoice_detail.label.invoice_id'), "placeholder" => trans('account::invoice_detail.placeholder.invoice_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'product_id' => [ "type" => 'numeric', "label" => trans('account::invoice_detail.label.product_id'), "placeholder" => trans('account::invoice_detail.placeholder.product_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'decimal', "label" => trans('account::invoice_detail.label.price'), "placeholder" => trans('account::invoice_detail.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tax' => [ "type" => 'decimal', "label" => trans('account::invoice_detail.label.tax'), "placeholder" => trans('account::invoice_detail.placeholder.tax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'qty' => [ "type" => 'decimal', "label" => trans('account::invoice_detail.label.qty'), "placeholder" => trans('account::invoice_detail.placeholder.qty'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total' => [ "type" => 'decimal', "label" => trans('account::invoice_detail.label.total'), "placeholder" => trans('account::invoice_detail.placeholder.total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('account::invoice_detail.label.description'), "placeholder" => trans('account::invoice_detail.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }