Laravel Basic HTTP Auth Check Returning False

ぃ、小莉子 提交于 2019-12-05 05:38:46

It changed in 5.2 version.

If you will use session, csrf, cookie ext. you should to use "web" middleware like this in your routes:

Route::group(['middleware' => ['web']], function () {
//
});

And you can see in your project the new kernel.php file is like this:

/**
 * The application's route middleware groups.
 *
 * @var array
 */
protected $middlewareGroups = [
    'web' => [
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
        \Illuminate\Session\Middleware\StartSession::class,
        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
        \App\Http\Middleware\VerifyCsrfToken::class,
],

'api' => [
    'throttle:60,1',
],
];

More info: https://laravel.com/docs/5.2/releases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!