-1

In Laravel, If my project has five different types of user then I have to create five different authentications?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
vaibhav kanmeriya
  • 143
  • 1
  • 1
  • 9

2 Answers2

0
  1. You use a roles package that has roles, permissions, and levels, for laravel.

  2. Give the users a role.

  3. Assign different permissions to a role.

  4. Use middleware to check on permission in either the routing files, the controller, or in a Request class.

If you google laravel roles you can find popular composer packages to use.

jeremykenedy
  • 4,150
  • 1
  • 17
  • 25
0

If you already have five tables, then you can change Laravel that way to authenticate from five different tables.

Here is the answer for the same.

if you are planning to build a system from scratch you can use laravel package for role management.

Here is package you can use for same. - spatie/laravel-permission

Jigar
  • 3,055
  • 1
  • 32
  • 51