1
,我發現了錯誤:PHP Laravel定製的後衛錯誤
Auth guard [accountant] is not defined.
這是我config\auth.php
文件
<?php
return [
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
'admin' => [
'driver' => 'session',
'provider' => 'admins',
],
'admin-api' => [
'driver' => 'token',
'provider' => 'admins',
],
'accountant' => [
'driver' => 'session',
'provider' => 'accountants',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
'admins' => [
'driver' => 'eloquent',
'model' => App\Admin::class,
],
'accountants' => [
'driver' => 'eloquent',
'model' => App\Accountant::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
],
'admins' => [
'provider' => 'admins',
'table' => 'password_resets',
'expire' => 60,
],
'accountants' => [
'provider' => 'accountants',
'table' => 'password_resets',
'expire' => 60,
],
],
];
前面的警衛管理工作正常。但會計師後衛正在拋出一個錯誤。我做錯了什麼?
我已經添加在模型中後衛以及
也許嘗試'php工匠配置:清除'? – kjones
工作。爲什麼會發生? laravel緩存配置文件嗎? –
不是100%肯定,但過去我也被它咬了,我會添加一個答案 – kjones