From 44d39ef225b8e267e50cd81be32ae6a6f1b9eb24 Mon Sep 17 00:00:00 2001 From: ScriptingBeating Date: Tue, 10 Nov 2020 22:39:42 +0530 Subject: [PATCH 1/2] updated EmailVerificationRequest.php to check if user is not already verified --- .../Foundation/Auth/EmailVerificationRequest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php b/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php index 7f36ca17bae9..e64215a2103a 100644 --- a/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php +++ b/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php @@ -46,9 +46,10 @@ public function rules() */ public function fulfill() { - $this->user()->markEmailAsVerified(); - - event(new Verified($this->user())); + if (! $this->user()->hasVerifiedEmail()) { + $this->user()->markEmailAsVerified(); + event(new Verified($this->user())); + } } /** From 40f85a456c971b7fea49d83f288218e7572f8c91 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 10 Nov 2020 15:01:24 -0600 Subject: [PATCH 2/2] Update EmailVerificationRequest.php --- src/Illuminate/Foundation/Auth/EmailVerificationRequest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php b/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php index e64215a2103a..c9c43046ed2c 100644 --- a/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php +++ b/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php @@ -48,6 +48,7 @@ public function fulfill() { if (! $this->user()->hasVerifiedEmail()) { $this->user()->markEmailAsVerified(); + event(new Verified($this->user())); } }