Support the ongoing development of →
Authentication Laravel Requests
Last updated 2 years ago.

Make sure that in your config/auth you have this:

'guards' => [
		'web' => [
				'driver' => 'session',
				'provider' => 'users',

		'api' => [
				'driver' => 'passport',
				'provider' => 'users',
	Then your API routes should be protected like this:
Route::group(['prefix' => 'v1', 'middleware' => ['auth:api'], function () {

	Now from here:
Path Customization

When a user is successfully authenticated, they will be redirected to the /home URI. You can customize the post-authentication redirect location by defining a redirectTo property on the LoginController, RegisterController, ResetPasswordController, and VerificationController:

protected $redirectTo = '/'; Next, you should modify the RedirectIfAuthenticated middleware's handle method to use your new URI when redirecting the user.

If the redirect path needs custom generation logic you may define a redirectTo method instead of a redirectTo property:

protected function redirectTo() { return '/path'; }

Hope this helps,



Visit For Your Solution


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.