Skip to content
Advertisement

How can I redirect to different views based on user role or privilege in Laravel 8?

I put the function below in the LoginController class to redirect users to different views, and when after login I got this 419|expired page.

JavaScript

Advertisement

Answer

  1. First put this in your LoginController class: use IlluminateSupportFacadesAuth;

  2. comment out this line protected $redirectTo =… and also add this function in the LoginController class:

    public function redirectPath() {

    JavaScript

    }

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement