title: Laravel validation rules for array
body: <p>I actually need to do a validation, which needs to check for a filed which is </p>
  
  <ol>
  <li>Required</li>
  <li>Array</li>
  <li>Needs to have at least two columns</li>
  <li>One key name should be <code>correct_topic</code></li>
  <li>Other one needs to be <code>wrong_topic</code></li>
  </ol>
  
  <p>Now I am writing the rules like the following for other fields.</p>
  
  <pre><code>return [
           'category'   =&gt; 'required|numeric',
           'text' =&gt; 'required',
           'type' =&gt; 'required|numeric|in:1,2,3',
           'vendor'        =&gt; 'required|numeric|exists:users,id',
           'topic' =&gt; 'required|array'
         ];
  </code></pre>
  
  <p>How can I improve this and include the above mentioned validation for <code>topic</code> ?</p>
  
  <p>I am writing these rules in a <code>TopicRequest</code> class. Basically I need to check whether the filed <code>topic</code> is an array which has got at least 2 columns and not more than 4 and one of the array key should be <code>correct-topic</code> and others needs to be <code>wrong_topic_1</code> etc.  </p>
  
  <p>Is there any default validation rules that can be used effectively for this situation ?</p>