zongxiao449

423 经验值

namespace AppModels;

use IlluminateAuthAuthenticatable;
use IlluminateNotificationsNotifiable;

use IlluminateDatabaseEloquentModel;
use IlluminateAuthPasswordsCanResetPassword;
use IlluminateFoundationAuthAccessAuthorizable;
use IlluminateContractsAuthAuthenticatable as AuthenticatableContract;
use IlluminateContractsAuthAccessAuthorizable as AuthorizableContract;
use IlluminateContractsAuthCanResetPassword as CanResetPasswordContract;

use BicanRolesTraitsHasRoleAndPermission;
use BicanRolesContractsHasRoleAndPermission as HasRoleAndPermissionContract;

class User extends Model implements

AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract,
HasRoleAndPermissionContract

{

//因为laravel自带的Authorizable中有can方法,扩展包HasRoleAndPermission中也有can方法,现在要使用扩展包的can
use Notifiable, Authenticatable, Authorizable, CanResetPassword, HasRoleAndPermission{
    HasRoleAndPermission::can insteadof Authorizable; //A insteadof B 的意思是A代替B
}

结果报了个这样的错误 请问有什么办法可以解决?
Declaration of BicanRolesTraitsHasRoleAndPermission::is($role, $all = false) should be compatible with IlluminateDatabaseEloquentModel::is(IlluminateDatabaseEloquentModel $model)