@@ -105,14 +105,23 @@ public function updateProfileInformation(): void
105105 $ this ->user ->fill ($ validated );
106106
107107 if ($ this ->user ->isDirty ('email ' )) {
108+ if (is_null ($ this ->user ->email_verified_at )) {
109+ $ this ->dispatch ('toastify ' , [
110+ 'type ' => 'error ' ,
111+ 'message ' => 'Can \'t change email for unverified user! '
112+ ]);
113+
114+ return ;
115+ }
116+
108117 $ this ->user ->email_verified_at = null ;
109118 }
110119
111120 $ this ->user ->save ();
112121
113122 $ this ->dispatch ('toastify ' , [
114123 'type ' => 'success ' ,
115- 'message ' => 'User Profile Updated Successfully ! '
124+ 'message ' => 'User profile updated successfully ! '
116125 ]);
117126 }
118127
@@ -133,7 +142,7 @@ public function unlinkSocialAccount(string $provider): void
133142
134143 $ this ->dispatch ('toastify ' , [
135144 'type ' => 'success ' ,
136- 'message ' => 'Social Account Unlinked Successfully ! '
145+ 'message ' => 'Social Account unlinked successfully ! '
137146 ]);
138147 }
139148 }
@@ -146,7 +155,7 @@ public function disableTwoFactor(DisableTwoFactorAuthentication $disableTwoFacto
146155
147156 $ this ->dispatch ('toastify ' , [
148157 'type ' => 'success ' ,
149- 'message ' => 'Two-Factor Disable Successfully ! '
158+ 'message ' => 'Two-Factor disable successfully ! '
150159 ]);
151160 }
152161
@@ -158,7 +167,7 @@ public function deleteAccount(): void
158167
159168 $ this ->user ->delete ();
160169
161- Session::flash ('status ' , 'User Deleted Successfully ' );
170+ Session::flash ('status ' , 'User deleted successfully ' );
162171
163172 $ this ->redirectRoute ('users.home ' , navigate: true );
164173 }
0 commit comments