*/ use HasFactory, Notifiable, PasskeyAuthenticatable, TwoFactorAuthenticatable; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'role' => UserRole::class, 'two_factor_confirmed_at' => 'datetime', ]; } /** * Admins manage users on top of everything an editor can do. */ public function isAdmin(): bool { return $this->role === UserRole::Admin; } }