title: Laravel Validating Arrays Select fields
body: <p>Laravel easily validates array based form input fields</p>
  
  <pre><code>&lt;input name='input_name[0][0]"&gt;
  &lt;input name='input_name[0][1]"&gt;
  </code></pre>
  
  <p>with </p>
  
  <pre><code>'input_name.* = 'required',
  </code></pre>
  
  <p><a href="https://laravel.com/docs/5.5/validation#validating-arrays" rel="nofollow noreferrer">https://laravel.com/docs/5.5/validation#validating-arrays</a></p>
  
  <p>But how can I <strong>validate array based select fields?</strong></p>
  
  <p>I have a form where customer info is added, user has to choose the customer's gender and it's possible to add infinite number of customer. </p>
  
  <p>So i have a select for 1 customer:</p>
  
  <pre><code>&lt;select name="gender[0]"&gt;
  &lt;option selected="selected" disabled="disabled" hidden="hidden" value=""&gt;Gender&lt;/option&gt;
  &lt;option value="Male"&gt;Male&lt;/option&gt;
  &lt;option value="Female"&gt;Female&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>&lt;select name="gender[1]"&gt;...
  &lt;select name="gender[N]"&gt;
  </code></pre>
  
  <p>When I set the rule as:</p>
  
  <pre><code>'gender.*' =&gt; 'required'
  </code></pre>
  
  <p>It doesn't recognize an 'unchoosen' select-box as an error....</p>
  
  <p>But if I update validation rules to:</p>
  
  <pre><code>'gender[0]'=&gt;'required'
  'gender[1]'=&gt;'required'
  'gender[N]'=&gt;'required'
  </code></pre>
  
  <p>It works absolutely fine... (by "it works", I mean that it returns a mistake "Gender field is required").</p>
  
  <p>So, apparently Laravel has some problems with array based select names.</p>
  
  <p>Appreciate any help!</p>