title: Validating Array Keys in Laravel 5.2
body: <p>I have the following input form structure upon submission :</p>
  
  <pre><code>array:6 [▼
    "_method" =&gt; "PATCH"
    "_token" =&gt; "h7hb0yLzdYaFY0I4e1I7CQK7Niq9EqgXFTlramn9"
    "candidate" =&gt; array:4 [▶]
    "languages" =&gt; array:3 [▼
      0 =&gt; "ga"
      1 =&gt; "no"
      2 =&gt; "sk"
    ]
    "availabilities" =&gt; array:2 [▼
      "z" =&gt; array:1 [▶]
      2 =&gt; array:3 [▶]
    ]
    "experiences" =&gt; array:3 [▶]
  ]
  </code></pre>
  
  <p>I am trying to validate the 'availabilities' array keys to make sure they correspond to existing id's in the database:</p>
  
  <pre><code>'availabilities' =&gt; 'required|integer|exists:days_of_week,id',
  </code></pre>
  
  <p>If I use this rule it targets the main array, but the <code>exists</code> key is passing validation even when I use the browser console to change the id to something like 'z'. It fails on the <code>integer</code> rule because it retrieves an array as well. How does one validate array keys?</p>
  
  <p>The <a href="https://mattstauffer.co/blog/form-array-validation-in-laravel-5-2" rel="noreferrer">following example</a> uses a similar form structure. But it does not cover how the employee id could be validated. I saw people add an 'id' key along with 'name' and 'age' for example and to have a rule against that 'id' field, but it is cumbersome.</p>