错误是
InvalidArgumentException ... \厂商\ laravel \框架\ SRC \照亮\验证\ CreatesUserProviders.php42
config / auth.php
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
'admin' => [
'driver' => 'session',
'provider' => 'adminss',
],
],
这是我的管理员模型
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Admin extends Authenticatable
{
use Notifiable;
protected $guard = 'admin';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
protected $table = 'admins';
}
我用Google搜索了这个错误。但根本没有任何解决方案
更新 这是我的提供者数组
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
'admins' => [
'drivers' => 'eloquent',
'model' => App\Admin::class,
],
],
答案 0 :(得分:1)
好像你的config/auth.php
'provider' => 'admins'