Laravel How to change the default login redirect in Laravel 12 (The Simple Way)

Stop digging through middleware! Discover the simplest way to change the default /dashboard login redirect in Laravel 12.x by tweaking a single line in your config/fortify.php file.

Ish Sookun

1 min read

If you have recently spun up a new Laravel 12.x application using a starter kit (Livewire, React, etc), you are likely familiar with this flow: you log in successfully, and the application immediately redirects you to /dashboard.

While /dashboard is a sensible default for many SaaS applications, it isn't always what you need. Perhaps you are building an admin panel that lives at /panel, or maybe you are building a membership site or e-commerce store where the user should simply return to the homepage (/) after logging in.

If you dive into the official documentation, you might find yourself deep in bootstrap/app.php trying to customize the auth middleware logic. While that works, there is a much simpler configuration change that handles this in seconds.

The "Hard" Way: Middleware

Typically, the documentation guides developers to intercept the request within the bootstrap/app.php file to handle redirection for guests and authenticated users. This involves defining closures and logic that can clutter your bootstrap file if you only need a simple path change.

The "Easy" Way: Config Configuration

If your starter kit is powered by Laravel Fortify (which handles the backend authentication logic for kits like Jetstream), you don't need to touch your middleware or controllers. You can control this behavior directly from your configuration files.

Here is the one-line fix:

  1. Navigate to config/fortify.php.
  2. Locate the 'home' key (usually near the top of the file).
  3. Change the value from RouteServiceProvider::HOME (or '/dashboard') to your desired path.

To redirect to the Homepage:

'home' => '/',

To redirect to a custom Admin Panel:

'home' => '/panel',

Why this works

Laravel Fortify uses this configuration value to determine where to send the user immediately after the authentication guard confirms their credentials. By changing it here, you ensure that the redirect is consistent across your application without having to write custom redirection logic in your controllers.

Don't overcomplicate your authentication flow. Before you start writing custom middleware logic in Laravel 12, check your config/fortify.php file. A simple string change is often all it takes to get your users exactly where they need to go.