Login with permissions Laravel 5

0

I have a login system with permissions made with Laravel's Auth, where there are the options "Student" and "Teacher" to choose from.

For example: if he is a teacher, he will return with a screen to register evidence; if you are a student, you will return with a screen to view them. However, I do not want it to return to Laravel's own screen, I would like that when registering a user, it would separate the page that I created the respective option that the user chose.

How can I do this?

    
asked by anonymous 18.11.2017 / 19:55

1 answer

0

You can rewrite the login function in LoginController , and within if that checks the credentials auth()->attempt() you can put another if checking if you are a student or teacher, and return to the correct url. p>

For example:

return redirect()->intended('professor/dashboard');
    
20.11.2017 / 05:45