In Laravel, If my project has five different types of user then I have to create five different authentications?
If my project has five different types of user then I have to create five different authentications?
Asked
Active
Viewed 45 times
-1
-
you can use https://github.com/spatie/laravel-permission – Soheil Rahmat Sep 21 '19 at 04:42
-
No need to different authentication. You can store your all users in 'users table' and use laravel role permission package. https://github.com/spatie/laravel-permission – Abdullah Al Mamun Sep 21 '19 at 04:45
2 Answers
0
You use a roles package that has roles, permissions, and levels, for laravel.
Give the users a role.
Assign different permissions to a role.
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