可能是一个简单的问题,但我仍然不理解它背后的概念,
我应该用,
use LaravelArdent\Ardent\Ardent;
class User extends Ardent {}
Authenticatable
课程,现在我喜欢这个class User extends Authenticatable {}
我如何一起实现这一目标?
答案 0 :(得分:0)
由于当前版本的Ardent没有提供任何特性,根据定义,你不能拥有一个扩展两个基类的类,我建议从Laravel User类(Illuminate/Foundation/Auth/User
)移动实现进入你的模型并扩展LaravelArdent\Ardent\Ardent
。
以下代码应该足够,但尚未经过测试:
use LaravelArdent\Ardent\Ardent;
use Illuminate\Auth\Authenticatable;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends Ardent implements
AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use Authenticatable, Authorizable, CanResetPassword;
}