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' => [ 'journal_id' => [ "type" => 'numeric', "label" => trans('account::journal_detail.label.journal_id'), "placeholder" => trans('account::journal_detail.placeholder.journal_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'costcenter_id' => [ "type" => 'numeric', "label" => trans('account::journal_detail.label.costcenter_id'), "placeholder" => trans('account::journal_detail.placeholder.costcenter_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'ledger_id' => [ "type" => 'numeric', "label" => trans('account::journal_detail.label.ledger_id'), "placeholder" => trans('account::journal_detail.placeholder.ledger_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'coa_id' => [ "type" => 'numeric', "label" => trans('account::journal_detail.label.coa_id'), "placeholder" => trans('account::journal_detail.placeholder.coa_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'coa_name' => [ "type" => 'text', "label" => trans('account::journal_detail.label.coa_name'), "placeholder" => trans('account::journal_detail.placeholder.coa_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'debit' => [ "type" => 'decimal', "label" => trans('account::journal_detail.label.debit'), "placeholder" => trans('account::journal_detail.placeholder.debit'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'credit' => [ "type" => 'decimal', "label" => trans('account::journal_detail.label.credit'), "placeholder" => trans('account::journal_detail.placeholder.credit'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sort_order' => [ "type" => 'numeric', "label" => trans('account::journal_detail.label.sort_order'), "placeholder" => trans('account::journal_detail.placeholder.sort_order'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }