Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SneakyJoe's avatar

CORS error after Laravel 11 upgrade

Hello!

I have upgraded to Laravel 11 from Laravel 10.

I did the upgrade locally and everything was working fine.

I updated PHP from 8.1 to 8.3 I adjusted the packages composer.json according to the Laravel guide I run the sanctum migration

I did the same steps on my server now, however I can not log in anymore.

I have a vue frontend application (stand-alone, decoupled from the backend). The vue application runs under xyz-domain-com Laraval runs under api-domain-com

The browser console shows the followning:

Access to XMLHttpRequest at 'api-domain-com/sanctum/csrf-cookie' from origin 'xyz-domain-com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET api-domain-com/sanctum/csrf-cookie net::ERR_FAILED 500 (Internal Server Error)

Unfortunately I can't see any log entries in the laravel.log.

Is there any possibility to get additional log information (already set to debug) as the error message in the browser indicates a 500 error?

Thank you!

0 likes
2 replies
SneakyJoe's avatar

Ok found the issue.

Was checking the nginx logs and it showed a reference to PHP 8.1 (fpm).

I adjusted the nginx configuration accordingly and now everything works fine again.

Please or to participate in this conversation.