laravel/framework — pull request #281 by arvidbjorkstrom (2013-02-10 23:24:24+00:00)
Title: Convert to MessageBag when sending an array to `withErrors`

The `withErrors` method of Redirect Responses accepts either an instance of MessageProviderInterface (like Validator) or an array. This is nice since it gives you an easy way to send errors simply as an array.
The problem is that `withErrors` extracts the MessageBag object out of the MessageProviderInterface instance, but when sent an array it just passes it on unchanged.
When `withErrors` isn't in the picture the available `errors` variable in the session is an empty MessageBag.

This creates some problems since you cannot count on what type the `errors` variable is if you want to use the array approach.

That's why I modified `withErrors` to convert any array sent to it to a MessageBag before passing it on to the session.