添加 Bican\Roles 后找不到类 'AppModel'



我正在使用库Bican角色。我更改user.php:

<?php
namespace App;
use IlluminateNotificationsNotifiable;
use IlluminateFoundationAuthUser as Authenticatable;
use BicanRolesTraitsHasRoleAndPermission;
use BicanRolesContractsHasRoleAndPermission as HasRoleAndPermissionContract;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract, HasRoleAndPermissionContract
{
    use Authenticatable, CanResetPassword, HasRoleAndPermission,Notifiable;
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'surnames', 'email', 'password','phone',
    ];
    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
}

尝试注册新的用户时,以下错误:

class'app model'找不到

我尝试添加它

使用用户;

等,但仍然不起作用,有什么想法吗?谢谢

您需要添加

use IlluminateDatabaseEloquentModel;

到类声明的顶部,而不是use User;

您遇到的错误是

class'app model'找不到

不是

找不到类"用户"

尝试

 use IlluminateDatabaseEloquentModel;

最新更新