*/ use HasFactory, HasHelpdeskTickets, Notifiable, PasskeyAuthenticatable, TwoFactorAuthenticatable; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'helpdesk_agent' => 'boolean', 'helpdesk_admin' => 'boolean', ]; } /** * Backwards-compatible application-level admin check. * * Helpdesk currently owns the admin role, so this maps to the * Helpdesk admin permission flag. */ public function isAdmin(): bool { return $this->isHelpdeskAdmin(); } /** * Backwards-compatible application-level agent check. */ public function isAgent(): bool { return $this->isHelpdeskAgent(); } /** * Get the user's initials */ public function initials(): string { $initials = Str::initials($this->name, true); return Str::length($initials) > 1 ? Str::substr($initials, 0, 1).Str::substr($initials, -1) : $initials; } }