*/ use HasFactory, Notifiable; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'name', 'email', 'password', 'has_email_authentication' ]; /** * The attributes that should be hidden for serialization. * * @var list */ protected $hidden = [ 'password', 'remember_token', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'has_email_authentication' => 'boolean', ]; } public function canAccessPanel(Panel $panel): bool { return true; } public function hasEmailAuthentication(): bool { // This method should return true if the user has enabled email authentication. return $this->has_email_authentication; } public function toggleEmailAuthentication(bool $condition): void { // This method should save whether or not the user has enabled email authentication. $this->has_email_authentication = $condition; $this->save(); } }