what does $guard in Admin or User do?

Posted 9 months ago by michaelnguyen547

I am reading some multi auth tutorial and most of them add protected $guard = 'admin' to Admin class. I can not find anything in Laravel documentation about this protected $guard.

namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Admins extends Authenticatable
{
    
    protected $guard = 'admin';
    ......
}

anybody know about thing about this $guard ?

Please sign in or create an account to participate in this conversation.