I've got a new site running Laravel 5.2 (Laravel Framework version 5.2.39). NOTE: the routes file is NOT using the web middleware group, which is no longer needed and can cause this issue.
I've got a simple validation on the ContactController's store method:
$this->validate($request, [
'ContactFirst' => 'required|max:25',
'ContactLast' => 'required|max:25',
'ContactRole' => 'required|max:25',
'ContactEmail' => 'email|max:255',
'ContactPhone' => 'max:255',
]);
When I intentionally fail the validation, the site redirects back to the form, but the error bag is empty so no error info is provided.
In the form view (resources/contacts/new.blade.php) I put the following code from the docs as well as a dump:
{{var_dump($errors)}}
@if (count($errors) > 0)
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
The page (as I said) redirects back to the form and the inputs are populated. But $errors is empty and no messages are printed:
object(Illuminate\Support\ViewErrorBag)[285]
protected 'bags' =>
array (size=0)
empty
webmiddleware (I think that's the one you meant in the beginning of your question).webmiddleware is not being applied in theroutes.php