#403 Forbidden in Production or Staging with FilamentPHP

5 messages · Page 1 of 1 (latest)

sour gorge
#

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;
}

faint wingBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

main vortex
#

is the model implementing the FilamentUser contract?

#
use Filament\Models\Contracts\FilamentUser;


class User extends Authenticatable implements FilamentUser
#

try to run php artisan optimize:clear