From 5b372f98b5bb7d72bbaeed5e2505de32c91d0f86 Mon Sep 17 00:00:00 2001 From: Cameron Kemshal-Bell Date: Wed, 24 Apr 2024 21:56:36 +1000 Subject: [PATCH] fix: moved save in the update method --- app/Http/Controllers/ProfileController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index ad1118a09..73e39ba36 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -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); }