*/ use Billable, HasApiTokens, HasFactory, Notifiable, TwoFactorAuthenticatable; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'is_admin' => 'boolean', ]; } public function canAccessPanel(Panel $panel): bool { return $this->is_admin === true; } /** * Get the user's initials */ public function initials(): string { return Str::of($this->name) ->explode(' ') ->take(2) ->map(fn ($word) => Str::substr($word, 0, 1)) ->implode(''); } public function savedStations(): HasMany { return $this->hasMany(SavedStation::class); } public function notificationPreferences(): HasMany { return $this->hasMany(UserNotificationPreference::class); } public function notificationLogs(): HasMany { return $this->hasMany(NotificationLog::class); } }