*/ use HasFactory, Notifiable, PasskeyAuthenticatable, TwoFactorAuthenticatable; /** * @var array */ protected $attributes = [ 'reminder_months_before' => 1, 'ocr_provider' => 'none', 'locale' => 'en', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'reminder_months_before' => 'integer', 'ocr_api_key' => 'encrypted', ]; } /** * @return HasMany */ public function certificates(): HasMany { return $this->hasMany(Certificate::class); } /** * @return HasMany */ public function categories(): HasMany { return $this->hasMany(Category::class); } /** * 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; } }