config/auth.php
<?php
return [
'defaults' => [
'guard' => 'user',
'passwords' => 'user',
],
'guards' => [
'user' => [
'driver' => 'session',
'provider' => 'user',
],
'admin' => [
'driver' => 'session',
'provider' => 'admin',
],
],
'providers' => [
'user' => [
'driver' => 'eloquent',
'model' => 'App\User',
],
'admin' => [
'driver' => 'eloquent',
'model' => 'App\Admin',
],
],
'passwords' => [
'user' => [
'provider' => 'user',
'email' => 'auth.emails.password',
'table' => 'password_resets',
'expire' => 60,
],
'admin' => [
'provider' => 'admin',
'email' => 'auth.emails.password',
'table' => 'password_resets',
'expire' => 60,
]
]
];
?>
ルート.php
Route::get('/test1', function() {
return Auth::guard('admin');
});
Route::get('/test2', function() {
return Auth::guard('user');
});
ここに私が得ているエラーがあります
Illuminate\Auth\AuthManager::createDriver() の引数 1 がありません。C:\xampp\htdocs\storage\framework\compiled.php の 11193 行で呼び出され、定義されています。
どうしたの ?