这是我的代码:
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Authenticatable;
class Admin extends Model implements Illuminate\Contracts\Auth\Aunthenticatable
{
use Authenticatable;
}
如何解决此错误?
“App \ Illuminate \ Contracts \ Auth \ Aunthenticatable not found”
答案 0 :(得分:1)
您没有正确导入namespace
。请尝试以下代码:
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Authenticatable as AuthContract;
class Admin extends Model implements AuthContract
{
use Authenticatable;
}
答案 1 :(得分:0)
你应该写这个。希望这能解决您的问题
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class AdminModelOL extends Authenticatable {
use Notifiable;
}
您应该正确导入命名空间