Changing the Laravel Redirect Location After Login

  • March 11, 2015

Welcome to the incredibly popular Easy Laravel 5 companion blog. To celebrate the new edition's release (updated for Laravel 5.5!) use the discount code easteregg to receive 20% off the book or book/video package! » Buy the book

Laravel will by default redirect users to the Home controller following a successful login. However, it's entirely possible you would rather the user be redirected to the Welcome controller (or another controller altogether) and do away with the Home controller. Doing so is easy although although the solution isn't apparent. Read on to learn how.

To redirect the user to some other location following successful login (for instance the Welcome controller's index action), add the following property to the Auth controller (found in app/Http/Controllers/Auth/AuthController.php):

protected $redirectPath = '/';

After changing the location, you're free to delete the Home controller and associated view.