I have stack of calls in controller:
if ($validator->fails()) {
return Redirect::back()
->withErrors($validator)
->withInput();
}
The function withErrors
takes array of errors.
How can I display there messages in template?
I tried:
{{Session::get('MessageBag')}}
So, the latest edition is:
$errors = $validator->messages(); // Here I get $error with fillied data
return redirect('tour/create')
->withErrors($errors)
->withInput();
In template I do:
{{count($errors)}}
It gives me zero