In my app, I have a generic place for errors in the view that I display simply using:
show_messages($errors->getMessages());
In the show_messages
function I parse out the errors in the way I would like them displayed. However I started using some grouping in my forms like register[email]
. When I display the errors I use ->withErrors(Input::get('register'), 'register')
.
But now I can't dynamically get the messages becasue $errors->getMessages()
goes to default
message bag by default (which in this case is empty).
I can get the errors using $errors->register->getMessages()
, but that's assuming I know it will be register
. Looking at the ViewErrorBag
class I don't see any methods to provide the bag. Is there anyway to do this without altering the current class to get all the bags dynamically or all the messages in each bag dynamically?