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

GimmeMylanta's avatar

Breeze NextJS on Vercel not redirecting to /dashboard after login

Hey,

I am giving this Laravel breeze nextjs project a shot. What i have done is deployed the laravel api (https://frontend-api.domain.com) to a server and then the laravel breeze nextjs app (https://frontend.domain.com) to Vercel. But i am getting an issue with the login procedure ... I havent changed anything from the installation.

On my local setup when I successfully login, it takes me directly to (https://frontend.domain.com/dashboard), no issues at all. But when its up on Vercel, after a successful login, it tries to redirect me to /home on the API url (https://frontend-api.domain.com/home)

I cant figure out why this is working on one env and not the other. There has been no modification to the code.

Has anyone else run into this before? Any help would be greatly appreciated

0 likes
5 replies
drehimself's avatar

That seems odd...

If you look at the RouteServiceProvider.php file in a default Laravel app (without Breeze installed). You'll see:

public const HOME = '/home';

If you have Breeze installed, it will change it to:

public const HOME = '/dashboard';

So maybe you accidentally deployed a different version of the Laravel app to your server? Or maybe that constant was changed somehow.

At the same time, the redirects seem to happen on the frontend with the breeze-next app, which is confusing.

Anyways, I hope you figure it out eventually.

GimmeMylanta's avatar

@drehimself It is very odd ... I uploaded the API and Frontend without editing anything.

When installing Breeze on the API, i used the --api flag, which didnt actually change the HOME const, it is currently public const HOME = '/home'; ... But even if I did change that manually to /dashboard, it still 'redirects' to the API when it should be pointing to the frontend url it sets. But as you say, the redirect actually takes place on the frontend so that shouldnt matter

I thought it might have been an issue with Vercel, so i deployed the frontend to Netlify, but it still does the same thing.

bol77's avatar

Hello, sorry for bothering, but i am desperate to solve this same issue... Could you tell me what is the solution if you found it? i would really appreciate it

Gabemachado's avatar

@bol77

I managed to fix this issue by changing the .htaccess and changing the .env. If you're still having this problem, I'm happy to help.

MelihCelik's avatar

@Gabemachado Hi I'm still looking for a solution desperately. Could you help if you have resolved the issue ?

Please or to participate in this conversation.