403 Forbidden in Production or Staging with FilamentPHP

APP_ENV is set to local, I can access the admin panel without any issues. However, when I switch to APP_ENV=production or staging, I get a 403 Forbidden error when trying to access the admin panel. I have already defined canAccessPanel() in the User model to always return true: public function canAccessPanel(Panel $panel): bool { return true; }
1 Reply
Bruno Pereira
Bruno Pereira2d ago
is the model implementing the FilamentUser contract?
use Filament\Models\Contracts\FilamentUser;


class User extends Authenticatable implements FilamentUser
use Filament\Models\Contracts\FilamentUser;


class User extends Authenticatable implements FilamentUser
try to run php artisan optimize:clear

Did you find this page helpful?