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_id' => [ "type" => 'numeric', "label" => trans('orderpostmate::orderpostmate.label.order_id'), "placeholder" => trans('orderpostmate::orderpostmate.placeholder.order_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'service_fee' => [ "type" => 'text', "label" => trans('orderpostmate::orderpostmate.label.service_fee'), "placeholder" => trans('orderpostmate::orderpostmate.placeholder.service_fee'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'delivery_fee' => [ "type" => 'text', "label" => trans('orderpostmate::orderpostmate.label.delivery_fee'), "placeholder" => trans('orderpostmate::orderpostmate.placeholder.delivery_fee'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'zing_fee' => [ "type" => 'text', "label" => trans('orderpostmate::orderpostmate.label.zing_fee'), "placeholder" => trans('orderpostmate::orderpostmate.placeholder.zing_fee'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'PRIMARY' => [ "type" => 'package::package.formcontrols.KEY', "label" => trans('orderpostmate::orderpostmate.label.PRIMARY'), "placeholder" => trans('orderpostmate::orderpostmate.placeholder.PRIMARY'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }