Level 88
You removed the web guard, so that's why your applications break. Make sure you add it again
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
// Other guards
],
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi.
I created extra guards. Now all routes are not working any more. I get guard not defined error. What is wrong with this?
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
'guards' => [
'admin' => [
'driver' => 'session',
'provider' => 'admins',
],
'student' => [
'driver' => 'session',
'provider' => 'student',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
],
'providers' => [
'admins' => [
'driver' => 'eloquent',
'model' => App\Admin::class,
],
'students' => [
'driver' => 'eloquent',
'model' => App\Student::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
Please help
You removed the web guard, so that's why your applications break. Make sure you add it again
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
// Other guards
],
Please or to participate in this conversation.