DEV Community

AquaCat
AquaCat

Posted on

【Laravel】How to change redirect URL in authentication

When you are making app with Laravel and using automatically generated files made by "php artisan make:auth," you might want to know how to change their redirect url.

app>Http>Controllers>Auth>LoginController.php, for eaxample.
There is a code as below.

protected $redirectTo = '/home';
Enter fullscreen mode Exit fullscreen mode

When user has logged in correctly, the page is redirected to '/home.' You need to change '/home' to whatever you want to redirect to.

Top comments (0)