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_status' => [ "type" => 'select', "label" => trans('order::order.label.order_status'), "placeholder" => trans('order::order.placeholder.order_status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'subtotal' => [ "type" => 'text', "label" => trans('order::order.label.subtotal'), "placeholder" => trans('order::order.placeholder.subtotal'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tax' => [ "type" => 'text', "label" => trans('order::order.label.tax'), "placeholder" => trans('order::order.placeholder.tax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total' => [ "type" => 'text', "label" => trans('order::order.label.total'), "placeholder" => trans('order::order.placeholder.total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }