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_code' => [ "type" => 'text', "label" => trans('order::order.label.order_code'), "placeholder" => trans('order::order.placeholder.order_code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'seller_id' => [ "type" => 'numeric', "label" => trans('order::order.label.seller_id'), "placeholder" => trans('order::order.placeholder.seller_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'f_name' => [ "type" => 'text', "label" => trans('order::order.label.f_name'), "placeholder" => trans('order::order.placeholder.f_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'l_name' => [ "type" => 'text', "label" => trans('order::order.label.l_name'), "placeholder" => trans('order::order.placeholder.l_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'company_name' => [ "type" => 'text', "label" => trans('order::order.label.company_name'), "placeholder" => trans('order::order.placeholder.company_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country_id' => [ "type" => 'numeric', "label" => trans('order::order.label.country_id'), "placeholder" => trans('order::order.placeholder.country_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state_id' => [ "type" => 'numeric', "label" => trans('order::order.label.state_id'), "placeholder" => trans('order::order.placeholder.state_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sreet_address' => [ "type" => 'text', "label" => trans('order::order.label.sreet_address'), "placeholder" => trans('order::order.placeholder.sreet_address'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'apartment' => [ "type" => 'text', "label" => trans('order::order.label.apartment'), "placeholder" => trans('order::order.placeholder.apartment'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'zip_code' => [ "type" => 'text', "label" => trans('order::order.label.zip_code'), "placeholder" => trans('order::order.placeholder.zip_code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'subtotal' => [ "type" => 'decimal', "label" => trans('order::order.label.subtotal'), "placeholder" => trans('order::order.placeholder.subtotal'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total' => [ "type" => 'decimal', "label" => trans('order::order.label.total'), "placeholder" => trans('order::order.placeholder.total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'payment_mode' => [ "type" => 'radios', "label" => trans('order::order.label.payment_mode'), "placeholder" => trans('order::order.placeholder.payment_mode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'payment_status' => [ "type" => 'radios', "label" => trans('order::order.label.payment_status'), "placeholder" => trans('order::order.placeholder.payment_status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }