使用L4验证器的嵌套输入

Does anyone know how to validate nested input sets using the Laravel 4 validator?

I have a table with a set of line items, and each quantity field has the unique package id in square brackets in the name:

<input type="text" name="quantity[package_one]" />
<input type="text" name="quantity[package_two]" />

This results in a nested input array:

<?php

array(
  'quantity' => array(
    'package_one' => 3,
    'package_two' => 12
  )
);

Which is exactly what i want, but i'm unsure how to specify rules for these items using the validator class:

// Does not work :-(
Validator::make(Input::all(), array(
    'quantity[package_one]' => 'numeric|required|min:1',
    'quantity[package_two]' => 'numeric|required|min:1'
));

This does not seem to work, neither does nesting the rules under quantity. Obviously there are workarounds to this like building a custom array of input yourself before passing it to the validator etc, but what i'd like to know is:

is there a native, "Laravel" way of handling nested input like this?

Thanks in advance, Dan.

The dirty way....

Controller

$input = Input::all();
$input = array_merge($input, $input['quantity']);
Validator::make(Input::all(), array(
'package_one' => 'numeric|required|min:1',
'package_two' => 'numeric|required|min:1'
 ));

Validator does not look into nested arrays. just bring that array to the outer one and you are done. (you can unset $input['quntity'] if you want after that)

loophole here is, it assumes that $input['quantity'] is present in the array. You need to validate this before putting into validation.

Works but not efficient.

You could make an extra Validator object just for the quantity input. It requires more code but i think it's more robust than merging in to one array