造成这个问题的原因是5.2源码改动
There are two ways to fix this:
-
In your
kernel.php
file, you can move themiddleware \Illuminate\View\Middleware\ShareErrorsFromSession::class
back to theprotected $middleware
property. -
You can wrap all your web routes with a route group and apply the
web
middleware to them.
Route::group(['middleware' => 'web'], function() {
// Place all your web routes here...
});