driesvints/Alerts — pull request #8 by cillosis (2014-04-17 21:08:06+00:00)
Title: Alert Levels with Arrays

I had a use case where I wanted to be able to pass an array of messages to the ```Alert::error();``` method. This was because I had a MessageBag returned by the Validator and I wanted to set them all as errors without having to loop through each. For example:

$validator = Validator::make(Input::all(), $rules);
if ( ! $validator->passes())
{
Alert::error($validator->messages()->all())->flash();
}

To allow for this, I added a bit of code to detect if it the parameter is an array, and if so, loop through and perform the ```add()``` call on each item.