为什么客户实例的手动身份验证无法存储会话?

问题描述 投票:0回答:1

我正在尝试使用手动身份验证来验证客户实例。无法存储身份验证会话。当我刷新或转到另一页时,身份验证不确定。

 $user=Customer::find(1);
           Auth::login($user);
php laravel laravel-5.8
1个回答
-1
投票

请确保您的customer类继承了Authenticatable接口。例如,您的课程应类似于:

use Illuminate\Foundation\Auth\Customer as Authenticatable;

class Customer extends Authenticatable
{
   // YOur model code here
} 
© www.soinside.com 2019 - 2024. All rights reserved.