You might want to have a look at this thread: https://laracasts.com/discuss/channels/filament/filament-403-in-production
Filament Login fails in production (403 Forbidden) but works in local environment
I deployed my laravel API on a VM instance (Oracle Cloud) running Ubuntu 24.04, while my Nuxt Frontend is deployed on Vercel. I am using Laravel Sanctum for SPA authentication. Everything works fine, but when I try to log in as the admin on Filament, I get a 403 Forbidden. The same thing happens on the frontend: when a user tries to log in or make any POST request, it doesn't go through. Below is the error log from my log file.
[2025-12-04 15:37:08] local.ERROR: Route [login] not defined. {"exception":"[object] (Symfony\Component\Routing\Exception\RouteNotFoundException(code: 0): Route [login] not defined. at /var/www/my-laravel-app> [stacktrace] #0 /var/www/my-laravel-app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(883): Illuminate\Routing\UrlGenerator->route() #1 /var/www/my-laravel-app/vendor/laravel/framework/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php(278): route() #2 [internal function]: Illuminate\Foundation\Configuration\ApplicationBuilder->{closure:{closure:Illuminate\Foundation\Configuration\ApplicationBuilder::withMiddleware():276}:278}() - I can't paste everything here because it is a lot.
If I switch the APP_ENV variable to local, everything works on both sides. Still, whenever I switch to production, the frontend shows a 419 error when I'm trying to make a POST request, e.g a login, and the backend shows 403 when trying to log in via Filament.
I'm suspecting a CORS or CSRF issue, but I'm unsure how to pinpoint it.
Please or to participate in this conversation.