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' => [ 'client_id' => [ "type" => 'numeric', "label" => trans('address::address.label.client_id'), "placeholder" => trans('address::address.placeholder.client_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('address::address.label.name'), "placeholder" => trans('address::address.placeholder.name'), "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" => [], ], ], 'address_line1' => [ "type" => 'text', "label" => trans('address::address.label.address_line1'), "placeholder" => trans('address::address.placeholder.address_line1'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address_line2' => [ "type" => 'text', "label" => trans('address::address.label.address_line2'), "placeholder" => trans('address::address.placeholder.address_line2'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country_id' => [ "type" => 'numeric', "label" => trans('address::address.label.country_id'), "placeholder" => trans('address::address.placeholder.country_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state_id' => [ "type" => 'numeric', "label" => trans('address::address.label.state_id'), "placeholder" => trans('address::address.placeholder.state_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'district_id' => [ "type" => 'text', "label" => trans('address::address.label.district_id'), "placeholder" => trans('address::address.placeholder.district_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'location_id' => [ "type" => 'text', "label" => trans('address::address.label.location_id'), "placeholder" => trans('address::address.placeholder.location_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'postal_code' => [ "type" => 'numeric', "label" => trans('address::address.label.postal_code'), "placeholder" => trans('address::address.placeholder.postal_code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }