the home route setting is in RouteServiceProvider.php
public const HOME = '/home';
or change the $redirectTo value in RegisterController.php or LoginController.php
protected $redirectTo = RouteServiceProvider::HOME;
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys, how can I change the default redirectTo page after login/register?
@LarAlex you can replace the default LoginResponse class with your own implementation; this will require you to swap out the registered singleton, e.g.
// app/Providers/FortifyServiceProvider.php
use Laravel\Fortify\Contracts\LoginResponse as LoginResponseContract;
use App\Actions\Fortify\Http\Responses\LoginResponse;
// ...
public function boot()
{
$this->app->singleton(LoginResponseContract::class, LoginResponse::class);
// ...
As you can see this is registering an App\Actions\Fortify\Http\Responses\LoginResponse.php class in the Container, so you need to create a app/Actions/Fortify/Http/Responses/LoginResponse class:
class LoginResponse implements LoginResponseContract
{
/**
* Create an HTTP response that represents the object.
*
* @param \Illuminate\Http\Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function toResponse($request)
{
return redirect()->intended($request->user()->is_admin ? 'admin' : 'dashboard');
}
}
As you can see, this is checking the is_admin column on the authenticated User and determining where the user is redirected.
Please or to participate in this conversation.