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' => [ 'mode' => [ "type" => 'radios', "label" => trans('adjustment::adjustment.label.mode'), "placeholder" => trans('adjustment::adjustment.placeholder.mode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'reference' => [ "type" => 'text', "label" => trans('adjustment::adjustment.label.reference'), "placeholder" => trans('adjustment::adjustment.placeholder.reference'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date' => [ "type" => 'date_picker', "label" => trans('adjustment::adjustment.label.date'), "placeholder" => trans('adjustment::adjustment.placeholder.date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'account_id' => [ "type" => 'numeric', "label" => trans('adjustment::adjustment.label.account_id'), "placeholder" => trans('adjustment::adjustment.placeholder.account_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'reason_id' => [ "type" => 'numeric', "label" => trans('adjustment::adjustment.label.reason_id'), "placeholder" => trans('adjustment::adjustment.placeholder.reason_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('adjustment::adjustment.label.description'), "placeholder" => trans('adjustment::adjustment.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }