title: Laravel Validator Facade - Validate size based on another field value
body: <p>I have a form where the user must define the number of items to save and when you submit the form and parse it to JSON it looks like this:</p>
  
  <pre><code>{
   "numItems": 3,
   "items": [
       "1" : {"A": "Foo", "B:"bar"},
       "2" : {"A": "Foo", "B:"bar"},
       "3" : {"A": "Foo", "B:"bar"},
   ],
  }
  </code></pre>
  
  <p>And I want to validate that the number of items inside <code>items</code> matches with the value of <code>numItems</code>.</p>
  
  <p>I've tried with:</p>
  
  <pre><code>$aValidations = [
      "numItems" =&gt; "required|int|max:10",
      "items" =&gt; "required|array|size:numItems",
  ]
  </code></pre>
  
  <p>But even if the number of item matches the <code>numItems</code> value I get this:</p>
  
  <pre><code>{
      "message": "The given data was invalid.",
      "errors": {
          "items": ["The items must contain numItems items."]
      }
  }
  </code></pre>
  
  <p>How can I achieve this?</p>