Dees040 Dees040 - 1 year ago 184
PHP Question

ErrorBag is always empty in Laravel 5.2

I was creating a new Laravel project and when debugging the errors of a form request, I noticed that my ErrorBag was always empty. Even when in the controller

. I tried every solution I found on the internet but nothing worked.

Even when creating a fresh project with composer (as described here) my out of the box auth system has an empty error bag when leaving all the field empty.

And yes, all the routes are using the middleware group web.

Any ideas what is causing this problem? (Session::put() and Session::get() are working)

Answer Source

As of v5.2.27, released on 2015-03-25, all routes in app\Http\routes.php are now in the web middleware group by default. If you have explicitly specified this middleware group inside your app\Http\routes.php file, you should remove it and that should resolve your issue.