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' => [ 'parent_id' => [ "type" => 'numeric', "label" => trans('account::coa.label.parent_id'), "placeholder" => trans('account::coa.placeholder.parent_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'is_group' => [ "type" => 'radios', "label" => trans('account::coa.label.is_group'), "placeholder" => trans('account::coa.placeholder.is_group'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'radios', "label" => trans('account::coa.label.type'), "placeholder" => trans('account::coa.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'code' => [ "type" => 'text', "label" => trans('account::coa.label.code'), "placeholder" => trans('account::coa.placeholder.code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('account::coa.label.name'), "placeholder" => trans('account::coa.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('account::coa.label.description'), "placeholder" => trans('account::coa.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'remarks' => [ "type" => 'text', "label" => trans('account::coa.label.remarks'), "placeholder" => trans('account::coa.placeholder.remarks'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'debit' => [ "type" => 'decimal', "label" => trans('account::coa.label.debit'), "placeholder" => trans('account::coa.placeholder.debit'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'credit' => [ "type" => 'decimal', "label" => trans('account::coa.label.credit'), "placeholder" => trans('account::coa.placeholder.credit'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'balance' => [ "type" => 'decimal', "label" => trans('account::coa.label.balance'), "placeholder" => trans('account::coa.placeholder.balance'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'debit_or_credit' => [ "type" => 'radios', "label" => trans('account::coa.label.debit_or_credit'), "placeholder" => trans('account::coa.placeholder.debit_or_credit'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'icon' => [ "type" => 'text', "label" => trans('account::coa.label.icon'), "placeholder" => trans('account::coa.placeholder.icon'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'color' => [ "type" => 'text', "label" => trans('account::coa.label.color'), "placeholder" => trans('account::coa.placeholder.color'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }