File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ public function generateVerificationToken($expiresIn = null): string
177177 */
178178 public function isVerified (): bool
179179 {
180- return !!$ this ->data ['email_verified_at ' ];
180+ return !!( $ this ->data ['email_verified_at ' ] ?? false ) ;
181181 }
182182
183183 /**
@@ -186,6 +186,14 @@ public function isVerified(): bool
186186 */
187187 public function verifyEmail (): bool
188188 {
189+ if ($ this ->isVerified ()) {
190+ return true ;
191+ }
192+
193+ if (!isset ($ this ->data ['email_verified_at ' ])) {
194+ $ this ->db ->query ("ALTER TABLE " . Config::get ('db.table ' ) . " ADD COLUMN email_verified_at TIMESTAMP NULL DEFAULT NULL " )->execute ();
195+ }
196+
189197 $ this ->data ['email_verified_at ' ] = tick ()->format (Config::get ('timestamps.format ' ));
190198
191199 try {
You can’t perform that action at this time.
0 commit comments