我在Laravel 5.3中有2名后卫:web
和admin
。
我需要在Laravel 5.3中将Auth::guard('web')
转换为Auth::guard('user')
吗?
如何将web
转换为user
?
更改auth.php
后:
'defaults' => [
'guard' => 'user',
'passwords' => 'users',
],
'guards' => [
'user' => [
'driver' => 'session',
'provider' => 'users',
],
'admin' => [
'driver' => 'session',
'provider' => 'admin',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
'admin' => [
'driver' => 'eloquent',
'model' => App\Admin::class,
],
],
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
],
],
答案 0 :(得分:2)
您应该打开Post -> Topic (taxonomy)
- Arts
- Ideas
- Politics
-> Theme (taxonomy)
- Insights
- Science
- Philosophy
您应该在config/auth.php
和web
数组中的user
数组和guards
数组上更新defaults
至providers
,您将拥有passwords
。