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' => [ 'coa_id' => [ "type" => 'numeric', "label" => trans('account::ledger.label.coa_id'), "placeholder" => trans('account::ledger.placeholder.coa_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'ledgerable_id' => [ "type" => 'numeric', "label" => trans('account::ledger.label.ledgerable_id'), "placeholder" => trans('account::ledger.placeholder.ledgerable_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'ledgerable_type' => [ "type" => 'text', "label" => trans('account::ledger.label.ledgerable_type'), "placeholder" => trans('account::ledger.placeholder.ledgerable_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'company_id' => [ "type" => 'decimal', "label" => trans('account::ledger.label.company_id'), "placeholder" => trans('account::ledger.placeholder.company_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'branch_id' => [ "type" => 'text', "label" => trans('account::ledger.label.branch_id'), "placeholder" => trans('account::ledger.placeholder.branch_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date' => [ "type" => 'date_time_picker', "label" => trans('account::ledger.label.date'), "placeholder" => trans('account::ledger.placeholder.date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('account::ledger.label.name'), "placeholder" => trans('account::ledger.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('account::ledger.label.description'), "placeholder" => trans('account::ledger.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'debit' => [ "type" => 'decimal', "label" => trans('account::ledger.label.debit'), "placeholder" => trans('account::ledger.placeholder.debit'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'credit' => [ "type" => 'decimal', "label" => trans('account::ledger.label.credit'), "placeholder" => trans('account::ledger.placeholder.credit'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'currency' => [ "type" => 'text', "label" => trans('account::ledger.label.currency'), "placeholder" => trans('account::ledger.placeholder.currency'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'currency_rate' => [ "type" => 'decimal', "label" => trans('account::ledger.label.currency_rate'), "placeholder" => trans('account::ledger.placeholder.currency_rate'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'currency_value' => [ "type" => 'decimal', "label" => trans('account::ledger.label.currency_value'), "placeholder" => trans('account::ledger.placeholder.currency_value'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }