From e259e24e6ecc14402b2d2ca20f321269c432dcee Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 19:23:33 +0000 Subject: [PATCH] Implement FilamentUser on the User model Filament 5.6 now denies panel access with a 403 outside the local environment when the authenticated user model does not implement the FilamentUser contract. Implement it with the existing semantics: any authenticated user may access the dashboard. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_0157S7dDNDwYuqWsqeg1DB94 --- src/Models/User.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Models/User.php b/src/Models/User.php index 248bbebc..4ae2d086 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -8,6 +8,8 @@ use Filament\Auth\MultiFactor\App\Concerns\InteractsWithAppAuthenticationRecovery; use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthentication; use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthenticationRecovery; +use Filament\Models\Contracts\FilamentUser; +use Filament\Panel; use Illuminate\Auth\MustVerifyEmail as MustVerifyEmailTrait; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Contracts\Translation\HasLocalePreference; @@ -27,7 +29,7 @@ * @property ?string $app_authentication_secret * @property ?array $app_authentication_recovery_codes */ -class User extends Authenticatable implements CachetUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasLocalePreference, MustVerifyEmail +class User extends Authenticatable implements CachetUser, FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasLocalePreference, MustVerifyEmail { /** @use HasFactory */ use HasApiTokens, HasFactory, InteractsWithAppAuthentication, InteractsWithAppAuthenticationRecovery, MustVerifyEmailTrait, Notifiable; @@ -69,6 +71,14 @@ protected function casts(): array ]; } + /** + * Determine if the user can access the given Filament panel. + */ + public function canAccessPanel(Panel $panel): bool + { + return true; + } + /** * Determine if the user is an admin. */