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' => [ 'customer_id' => [ "type" => 'numeric', "label" => trans('account::invoice.label.customer_id'), "placeholder" => trans('account::invoice.placeholder.customer_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'serial_no' => [ "type" => 'numeric', "label" => trans('account::invoice.label.serial_no'), "placeholder" => trans('account::invoice.placeholder.serial_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'invoice_date' => [ "type" => 'date_time_picker', "label" => trans('account::invoice.label.invoice_date'), "placeholder" => trans('account::invoice.placeholder.invoice_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'due_date' => [ "type" => 'date_time_picker', "label" => trans('account::invoice.label.due_date'), "placeholder" => trans('account::invoice.placeholder.due_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'customer_note' => [ "type" => 'text', "label" => trans('account::invoice.label.customer_note'), "placeholder" => trans('account::invoice.placeholder.customer_note'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sub_total' => [ "type" => 'decimal', "label" => trans('account::invoice.label.sub_total'), "placeholder" => trans('account::invoice.placeholder.sub_total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tax_type' => [ "type" => 'text', "label" => trans('account::invoice.label.tax_type'), "placeholder" => trans('account::invoice.placeholder.tax_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tax_rate' => [ "type" => 'decimal', "label" => trans('account::invoice.label.tax_rate'), "placeholder" => trans('account::invoice.placeholder.tax_rate'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tax_amount' => [ "type" => 'decimal', "label" => trans('account::invoice.label.tax_amount'), "placeholder" => trans('account::invoice.placeholder.tax_amount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'discount' => [ "type" => 'decimal', "label" => trans('account::invoice.label.discount'), "placeholder" => trans('account::invoice.placeholder.discount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total' => [ "type" => 'decimal', "label" => trans('account::invoice.label.total'), "placeholder" => trans('account::invoice.placeholder.total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'notes' => [ "type" => 'text', "label" => trans('account::invoice.label.notes'), "placeholder" => trans('account::invoice.placeholder.notes'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'documents' => [ "type" => 'text', "label" => trans('account::invoice.label.documents'), "placeholder" => trans('account::invoice.placeholder.documents'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }