0

I customized the app\Actions\Fortify\UpdateUserProfileInformation.php file with new fields.

There is a ZIP code search performed with JQuery, but when there is a change of address, the new data is not updated. Below is a screenshot of the dump.

View Code

<div class="flex col-span-6 sm:col-span-4 justify-items-center">
    <div class="w-1/4">
        <x-label for="zipcode" value="{{ __('CEP') }}" />
        <x-input x-mask="99999-999" id="zipcode" type="text" name="zipcode" class="mt-1 block w-full" wire:model="state.zipcode"/>
        <x-input-error for="zipcode" class="mt-2" />
    </div>
    <div class="w-2/4 ml-5">
        <x-label for="street" value="{{ __('Logradouro') }}" />
        <x-input id="street" type="text" name="street" class="mt-1 block w-full" wire:model="state.street"/>
        <x-input-error for="street" class="mt-2" />
    </div>
    <div class="w-1/4 ml-5">
        <x-label for="number" value="{{ __('Num.') }}" />
        <x-input id="number" type="text" name="number" name="number" class="mt-1 block w-full" wire:model="state.number"/>
        <x-input-error for="number" class="mt-2" />
    </div>
</div>

UpdateUserProfileInformation.php

if ($input['email'] !== $user->email &&
    $user instanceof MustVerifyEmail) {
    $this->updateVerifiedUser($user, $input);
} else {
    $user->forceFill([
        'name' => $input['name'],
        'email' => $input['email'],
        'cell_phone' => $input['cell_phone'],
        'blood_type' => $input['blood_type'],
        'contact_name' => $input['contact_name'],
        'contact_phone' => $input['contact_phone'],
        'birth_date' => $input['birth_date'],
        'shirt_size' => $input['shirt_size'],
        'shirt_sleeve' => $input['shirt_sleeve'],
        'shirt_name' => $input['shirt_name'],
        'street' => $input['street'],
        'number' => $input['number'],
        'complement' => $input['complement'],
        'neighborhood' => $input['neighborhood'],
        'city' => $input['city'],
        'state' => $input['state'],
        'zipcode' => $input['zipcode'],
    ])->save();
}

Screenshot

Screenshot

Screenshot

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.