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' => [ 'order_number' => [ "type" => 'text', "label" => trans('refund::refund.label.order_number'), "placeholder" => trans('refund::refund.placeholder.order_number'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'order_amount' => [ "type" => 'text', "label" => trans('refund::refund.label.order_amount'), "placeholder" => trans('refund::refund.placeholder.order_amount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'last_digits' => [ "type" => 'text', "label" => trans('refund::refund.label.last_digits'), "placeholder" => trans('refund::refund.placeholder.last_digits'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'reason' => [ "type" => 'text', "label" => trans('refund::refund.label.reason'), "placeholder" => trans('refund::refund.placeholder.reason'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('refund::refund.label.email'), "placeholder" => trans('refund::refund.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'PRIMARY' => [ "type" => 'package::package.formcontrols.KEY', "label" => trans('refund::refund.label.PRIMARY'), "placeholder" => trans('refund::refund.placeholder.PRIMARY'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }