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

soniceran's avatar

Laravel Breeze - Next.js deployment

Did anyone manage to deploy Breeze - Next.js into production with domain names ?

0 likes
8 replies
soniceran's avatar

This is all working just fine, if I am using localhost with port 3000 for NextJS and laravel serve to fire up laravel on port 8000.

But if I try to run the next on a subdomain (e.g NextJs on app.mydomain.test and laravel on mydomain.test )

Then it all starting to break with 419 errors or strange CORS errors

To replicate, one can locally use valet :

valet link mydomain.test
valet proxy app.mydomain.test  http://localhost:3000/
hennio's avatar

Same for me. On localhost it is working for me. When I deploy breeze-next to Vercel and host my laravel-api (respectively domain.com & api.domain.com).

In Vercel the only environment variable I have set was;

NEXT_PUBLIC_BACKEND_URL=https://api.domain.com

The submit on the login form doesnt seem to submit anything.

I tried my breeze-next locally and connect to api.domain.com, that doesnt work either. Then it gives me the folowing error;

Unhandled Runtime Error
Error: Request failed with status code 419

Call Stack
createError
node_modules/axios/lib/core/createError.js (16:0)
settle
node_modules/axios/lib/core/settle.js (17:0)
XMLHttpRequest.onloadend
node_modules/axios/lib/adapters/xhr.js (54:0)

And yes; I changed the domains in the .env (Laravel) and the .env.local (breeze-next) and double checked the https / http parts.

Nav's avatar

@hennio I’m having the same problem. Your blog post is returning a 404 page. Can you share your solution here? Thanks.

Please or to participate in this conversation.