*/ use HasFactory, InteractsWithAppAuthentication, InteractsWithAppAuthenticationRecovery, Notifiable; /** * Accounts are created by administrators only; an account without a role has no access. */ public function canAccessPanel(Panel $panel): bool { return $this->role !== null; } public function hasRole(UserRole ...$roles): bool { return in_array($this->role, $roles, true); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'role' => UserRole::class, ]; } }