You can change it in the RouteServiceProvider::class
/**
* The path to the "home" route for your application.
*
* This is used by Laravel authentication to redirect users after login.
*
* @var string
*/
public const HOME = '/home';
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When I log into my app (using Breeze for auth), I want to go somewhere other than /home. From reading various docs, this seems like a simple thing: edit app/Http/Controllers/Auth/LoginController.php and change $redirectTo to point where I want it to go, right?
Unfortunately that's not working. No matter what I put in there, even non-existent routes, I end up at /.
I actually want to do something a little more sophisticated, where the user is directed to different pages according to their roles, so I have a method in my User model that figures out where that should be. To avoid this being a source of problems, I've also tried to do all this with the stock static config.
With xdebug, I've traced the process. It hits Breeze's AuthenticatedSessionController::store(), which returns redirect()->intended($default) and I can see that the correct route is passed as $default. However, intended() pulls url.intended from the session, and goes there instead of the route I passed in, and I can see that the resulting URL is indeed /. So then the question is how does url.intended get set to this since this is the very first authenticated URL it's hitting? I can't find any other references to that session value, so I've not found where it is set.
What's more confusing is that if I log out and then log back in again it goes to the right place! The wrong destination only occurs on a fresh login (e.g. in a new incognito window). I can only explain this as the intended destination being stored in the session the first time, and then turning up as url.intended the second time.
I've found I can bodge this into working by skipping the intended call in the session controller, and returning redirect()->to($default) directly, however, I'm concerned that this might have unintended consequences, for example breaking deep links that need to do a login first.
Any ideas what I'm doing wrong?
@jlrdw I've tracked down the problem. I was helped by this post. The issue is that when I visit the domain directly, https://www.example.com/, it requires auth, and so it stores / as the intended destination, and redirects me to /login. Then after login, it redirects me back to my intended destination at /. If I go directly to /login in a fresh session, my targeting works correctly because it never had to do the redirect away from /, and so the call to intended() falls through to the default route param I'm passing in. While I can understand the reasoning here, it's unhelpful because default redirection can never work in this scenario (requiring auth for /), and it won't matter what you put in $redirectTo or HOME.
I think the only solution here is to remove the call to intended.
Please or to participate in this conversation.