laravel/framework — pull request #1340 by KaneCohen (2013-05-17 19:53:38+00:00)
Title: Add array items validation and wildcard support. 

Ok, i know that you've asked me to stop making PRs on validation, but after a lot of thought i came to the conclusion that it's impossible to make Validator intelligent enough so that it'll know when and how to validate an array and its contents.

Simple example. Validate following array against these rules:

* Make sure that it's an array
* It has at least 3 items in it
* Each item is a string and has at least 3 character in it
* Check each item with exists

I think it's just not possible unless you have at least two attributes and some serious magic in Validator going on. This PR tries to make it easy to use and to understand for a developer without serious docs crunching or voodoo magic.

````php

$input = array('input' => array('foo', 'bar', 'baz'));
$rules = array(
'input' => 'Array|Min:3',
'input.*' => 'String|Min:3'
);

$v = Validator::make($input, $rules);

````

First rule makes sure our `input` attribute is an array with at least three items. **Check**.
Second rules uses `array_select` and wildcrads to check each item of the array if it's a string and if it has at least 3 characters. I think it's pretty simple and intuitive.

Based upon my two other PRs: #1134 and #833.