Can you please attach a snippet of your code so that others can understand your request and help you find what you want.
Multi Authentication
i have users table and column Type. i need check user type admin or user and Multiple Authentication my users table Uname password Type user->0 Admin->1
@isuru97 Jeffreys free "from scratch" series has a free video on authentication and authorization.
Needed
- A users table
- User either can or cannot do something
- An admin is a user.
- A user is a user.
Google:
https://www.google.com/search?client=firefox-b-1-d&q=site%3Alaracasts.com+multi+authentication
There are some other discussions in above link on multi authentication.
Also
https://laracasts.com/discuss/channels/laravel/security-in-controller
https://laracasts.com/discuss/channels/laravel/multi-auth-on-laravel-using-the-same-login-page
https://laracasts.com/discuss/channels/laravel/using-laravel-policy-to-filter-eloquent-query
https://laracasts.com/discuss/channels/code-review/multi-auth-with-different-login-forms
https://laracasts.com/discuss/channels/laravel/users-userdetails-tables
https://laracasts.com/discuss/channels/laravel/policy-logic
https://laracasts.com/discuss/channels/laravel/security-in-controller
And a good package:
https://github.com/spatie/laravel-permission
But if you learn RBAC, not needed.
In fact an example from spatie examples:
quote
public function update(User $user, Post $post)
{
if ($user->can('edit own posts')) {
return $user->id === $post->user_id;
}
if ($user->can('edit all posts')) {
return true;
}
}
unquote
Please or to participate in this conversation.