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' => [ 'company_id' => [ "type" => 'numeric', "label" => trans('account::journal.label.company_id'), "placeholder" => trans('account::journal.placeholder.company_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'branch_id' => [ "type" => 'numeric', "label" => trans('account::journal.label.branch_id'), "placeholder" => trans('account::journal.placeholder.branch_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'code' => [ "type" => 'text', "label" => trans('account::journal.label.code'), "placeholder" => trans('account::journal.placeholder.code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date' => [ "type" => 'date_picker', "label" => trans('account::journal.label.date'), "placeholder" => trans('account::journal.placeholder.date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'ref' => [ "type" => 'text', "label" => trans('account::journal.label.ref'), "placeholder" => trans('account::journal.placeholder.ref'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'narration' => [ "type" => 'text', "label" => trans('account::journal.label.narration'), "placeholder" => trans('account::journal.placeholder.narration'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'note' => [ "type" => 'text', "label" => trans('account::journal.label.note'), "placeholder" => trans('account::journal.placeholder.note'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'docs' => [ "type" => 'text', "label" => trans('account::journal.label.docs'), "placeholder" => trans('account::journal.placeholder.docs'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }