身份验证驱动程序/"Multi-Auth"
在发布laravel 5.2之前,声明多个auth支持开箱即用.但是没有任何示例代码显示如何使用具有路由的不同驱动程序进行身份验证.所以我需要帮助使用默认的laravel 5.2设置multi-auth
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, ] ] ];