diff --git a/stubs/UpdateUserProfileInformation.php b/stubs/UpdateUserProfileInformation.php index 2208cbbe..b8afd710 100644 --- a/stubs/UpdateUserProfileInformation.php +++ b/stubs/UpdateUserProfileInformation.php @@ -29,9 +29,19 @@ public function update($user, array $input) ], ])->validateWithBag('updateProfileInformation'); - $user->forceFill([ - 'name' => $input['name'], - 'email' => $input['email'], - ])->save(); + if ($input['email'] != $user->email & new User instanceof MustVerifyEmail) { + $user->forceFill([ + 'name' => $input['name'], + 'email' => $input['email'], + // 'email_verified_at' => null, // If uncommented, this will force user to verify email before being able to navigate to any route requiring auth + ])->save(); + + $user->sendEmailVerificationNotification(); + } else { + $user->forceFill([ + 'name' => $input['name'], + 'email' => $input['email'], + ])->save(); + } } }