使用Tymond 1.0时,如何在Laravel 5.8中更改身份验证防护?我想验证用户agains两个表。我正在使用Laravel 5.8。如果我做错了事,对不起。
这是我的auth.php
<?php
return [
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
'operador' => [
'driver' => 'token',
'provider' => 'operador',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
'operador' => [
'driver' => 'eloquent',
'model' => App\Operador::class,
],
],
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 180,
],
],
];
如何选择后卫“ operador”
$credenciais = $request->only('email', 'password');
$token = JWTAuth::attempt($credenciais)
我想即时更改。不修改auth.php默认值。换句话说,我希望能够选择表来检索用户。