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' => [ 'company_id' => [ "type" => 'numeric', "label" => trans('address::address.label.company_id'), "placeholder" => trans('address::address.placeholder.company_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'ou_id' => [ "type" => 'numeric', "label" => trans('address::address.label.ou_id'), "placeholder" => trans('address::address.placeholder.ou_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('address::address.label.title'), "placeholder" => trans('address::address.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'text', "label" => trans('address::address.label.phone'), "placeholder" => trans('address::address.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address1' => [ "type" => 'text', "label" => trans('address::address.label.address1'), "placeholder" => trans('address::address.placeholder.address1'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address2' => [ "type" => 'text', "label" => trans('address::address.label.address2'), "placeholder" => trans('address::address.placeholder.address2'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'postal_code' => [ "type" => 'text', "label" => trans('address::address.label.postal_code'), "placeholder" => trans('address::address.placeholder.postal_code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country' => [ "type" => 'text', "label" => trans('address::address.label.country'), "placeholder" => trans('address::address.placeholder.country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state' => [ "type" => 'text', "label" => trans('address::address.label.state'), "placeholder" => trans('address::address.placeholder.state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'suburb' => [ "type" => 'text', "label" => trans('address::address.label.suburb'), "placeholder" => trans('address::address.placeholder.suburb'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_address_country' => [ "type" => 'text', "label" => trans('address::address.label.billing_address_country'), "placeholder" => trans('address::address.placeholder.billing_address_country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_address_state' => [ "type" => 'text', "label" => trans('address::address.label.billing_address_state'), "placeholder" => trans('address::address.placeholder.billing_address_state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_address_postalcode' => [ "type" => 'text', "label" => trans('address::address.label.billing_address_postalcode'), "placeholder" => trans('address::address.placeholder.billing_address_postalcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_address_address1' => [ "type" => 'text', "label" => trans('address::address.label.billing_address_address1'), "placeholder" => trans('address::address.placeholder.billing_address_address1'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }