We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a43294 commit 7fcdb97Copy full SHA for 7fcdb97
1 file changed
src/Auth/User.php
@@ -177,7 +177,7 @@ public function generateVerificationToken($expiresIn = null): string
177
*/
178
public function isVerified(): bool
179
{
180
- return !!$this->data['email_verified_at'];
+ return !!($this->data['email_verified_at'] ?? false);
181
}
182
183
/**
@@ -186,6 +186,14 @@ public function isVerified(): bool
186
187
public function verifyEmail(): bool
188
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
197
$this->data['email_verified_at'] = tick()->format(Config::get('timestamps.format'));
198
199
try {
0 commit comments