Laravel 5.3 Multi Auth with Heritage

Asked

Viewed 155 times

0

I am using Laravel 5.3 and came across a problem. I need to authenticate multiple types of users. I saw in the documentation and in some tutorials that it is possible to do this in Laravel, the problem is that all the ones I saw show how to do an authentication when each type of user has a different table, eg a table for admin, other for ordinary user and etc. In my database there are some tables such as, coordinator, teacher, student and others that have a foreignKey/primaryKey that refer to a table called user. I tried to do some implementations I saw in some tutorials like this: Best solution for three types of users, but it didn’t work. Remembering that there is only one login page for all users, because after a user login I will define what each type of user will be able to see or do in the system.

If anyone can give me a hint on how to authenticate, I’d really appreciate it.

  • See if this helps, but I think it refers to the Guard (user type, respective table) you want. http://answall.com/questions/161940/melhor-solução-para-três-tipos-de-usuários-no-laravel-5-3/161951#161951

  • it is better to use the technique of roles or paper, a user can play several roles, with this information, create specific middleware to protect your application.

  • Exactly @Miguel, this example uses respective tables for each type of user.

  • I decided to do exactly what @Virgilio Novic quoted, if this works out I communicate.

  • OK, good luck, so I also think it’s best

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.