Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

isuru97's avatar

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

0 likes
2 replies
NaghamH's avatar

Can you please attach a snippet of your code so that others can understand your request and help you find what you want.

jlrdw's avatar

@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/guys-need-a-big-suggestion-for-login-permission-for-different-users-laravel

https://laracasts.com/discuss/channels/general-discussion/authorization-policies-and-reducing-the-repitition

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/i-want-to-create-two-types-user-panel-for-two-types-user

https://laracasts.com/discuss/channels/laravel/users-userdetails-tables

https://laracasts.com/discuss/channels/site-improvements/is-it-best-practice-to-store-role-type-in-the-session

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.