Skip to content

Commit

Permalink
fix: moved save in the update method
Browse files Browse the repository at this point in the history
  • Loading branch information
CamKem committed Apr 24, 2024
1 parent 87016a4 commit 5b372f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ public function update(ProfileUpdateRequest $request): RedirectResponse

$emailChanged = $user->isDirty('email');

$user->save();

if ($emailChanged) {
$user->email_verified_at = null;
$user->save();
$user->sendEmailVerificationNotification();
}

$user->save();

if (! $user->is_uploaded_avatar && $emailChanged) {
UpdateUserAvatar::dispatch($user);
}
Expand Down

0 comments on commit 5b372f9

Please sign in to comment.