DEV Community

AquaCat
AquaCat

Posted on

2

【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)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay