Farirai's avatar

Trying to figure out how to change my auth redirect in laravel foftify after login want to redirect to dashboard.index insteda og home

I changed the Fortify configuration to redirect to 'dashboard' => '/dashboard', but it still redirects to the home page.

If I run php artisan optimize without the home route in web.php, I get a 404 error on the home page.

0 likes
2 replies
jhyaps's avatar
jhyaps
Best Answer
Level 1

There are few steps to follow.

Ensure your dashboard route

Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard.index');

Also make sure you changed in the routeserviceprovider

public const HOME = '/home';

to

public const HOME = '/dashboard';

Change the fortify.php home path to

'home' =>  RouteServiceProvider::HOME,

this is the approach I follow while working with fortify.

2 likes

Please or to participate in this conversation.