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

futuremandigital's avatar

protected redirectTo on Login does not work

I'm stumped here.

I'm simply trying to change the redirect route from /home to /projects in my current spark project and clearly the LoginController has the field defined for it

/**
 * Where to redirect users after login.
 *
 * @var string
 */
protected $redirectTo = '/home';

So I change it here and it does not do it. It still goes to home. Is this a bug or am I missing something.

Right now the only other solution is to simply override that route in my routes web.php file and do it within closure but that doesn't seem elegant.

Anyone else have any suggestions?

0 likes
1 reply
freddyheppell's avatar
Level 4

I believe that the LoginController in the app directory isn't used by spark. It has its own controller. As it's a bad idea to edit the Spark source code, setting up a redirect is probably the best option.

Please or to participate in this conversation.