Undefined variable: errors in Laravel 5.2 Solved, is what we are going to discuss. But before that, The Auth Guard Authentication in Laravel 5.2, one of the major change in Laravel 5.2 is the implementation of the new concept guard. With several changes, Laravel has becoming little bit more stronger than before. But, the problem is, it’s little confusing to implement.And there was a problem Undefined variable: errors in Laravel, due to the recent changes.
To solve the problem of “Undefined variable: errors” in the latest update, you have to know what is really happening. In the latest version, Laravel 5.2 the middleware (the globally used one) responsible for has been moved from global middleware to web (what ever you are using, you can configure this) middleware group.
To fix this problem, you can move the middleware IlluminateViewMiddlewareShareErrorsFromSession::class
back to the protected $middleware
.Also, you can add the routes with the same route group and apply to the middleware to them.
I have attached some screen shots of how i did it. Please take a look. I think now you solved “Undefined variable: errors in Laravel 5.2 Solved”.
Also, drop your comments, if you have found another solution (in a more easy way). Thanks for reading.