feat: implement premium Email 2FA authentication integrated with auth flow

This commit is contained in:
2026-05-21 21:46:53 +07:00
parent a0673129ee
commit 0d083765ff
50 changed files with 543 additions and 162 deletions
+4 -2
View File
@@ -16,8 +16,8 @@ use Spatie\Permission\Traits\HasRoles;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;
#[Fillable(['first_name', 'last_name', 'email', 'phone', 'bio', 'password', 'status', 'avatar_url', 'meta', 'two_factor_secret', 'two_factor_recovery_codes', 'two_factor_confirmed_at'])]
#[Hidden(['password', 'remember_token', 'two_factor_secret', 'two_factor_recovery_codes'])]
#[Fillable(['first_name', 'last_name', 'email', 'phone', 'bio', 'password', 'status', 'avatar_url', 'meta', 'two_factor_secret', 'two_factor_recovery_codes', 'two_factor_confirmed_at', 'email_2fa_enabled', 'email_2fa_code', 'email_2fa_expires_at'])]
#[Hidden(['password', 'remember_token', 'two_factor_secret', 'two_factor_recovery_codes', 'email_2fa_code'])]
class User extends Authenticatable
{
/** @use HasFactory<UserFactory> */
@@ -66,6 +66,8 @@ class User extends Authenticatable
'password' => 'hashed',
'meta' => 'array',
'status' => 'string',
'email_2fa_enabled' => 'boolean',
'email_2fa_expires_at' => 'datetime',
];
}