title: How to validate multiple input with the same name in a class extended from FormRequest
body: <p>I'm new to Laravel.</p>
  
  <p>I want to know how to validate multiple input with the same name.</p>
  
  <p>I have a validation rule for a POST request but this fails the validation although I have all values required.</p>
  
  <p>I noticed that the key names are not the same as the key names from user input, so I think that's causing the problem.</p>
  
  <p><a href="https://i.stack.imgur.com/CeV6v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CeV6v.png" alt="enter image description here"></a></p>
  
  <p>On the page I have a form like this, so, I have many input fields with the name like "visit[0]['did_visit']", "visit[1]['did_visit']", "visit[2]['did_visit']...</p>
  
  <p>But, I can't figure out how to validate these on my class extended from FormRequest class.</p>
  
  <p>Please help me!!</p>
  
  <h1>VisitRecordRequest extends FormRequest</h1>
  
  <pre><code>class VisitRecordRequest extends FormRequest
  {
  
  
      public function authorize()
      {
          return true;
      }
  
  
  
      public function rules()
      {
  
          switch($this-&gt;method())
          {
  
              case 'GET':
  
                  return [];
  
              case 'POST':
              {
  
                  //var_dump my input!!!
                  echo "&lt;pre&gt;";
                  var_dump($this-&gt;input());
                  echo "&lt;/pre&gt;";
  
                  exit;
  
                  return [
  
                      'date' =&gt; 'required',
                      'hour' =&gt; 'required',
                      'minute' =&gt; 'required',
                      'weather' =&gt; 'required',
                      'room_id' =&gt; 'required',
                      'did_visit' =&gt; 'required',
                      'bounce_zone' =&gt; 'required',
                      'bounce_reason' =&gt; 'required',
                      'next_action' =&gt; 'required',
  
                  ];
              }
  
              case 'PUT':
              {
                  return [];
  
              }
  
              case 'PATCH':
              {
                  return [];
              }
  
              case 'DELETE':
              {
                  return [];
              }
  
              default:break;
          }
  
          return [];
  
  
      }
  
  
      public function response(array $errors)
      {
  
      }
  
  
  }
  </code></pre>
  
  <h1>var_dump log</h1>
  
  <pre><code>array(2) {
    ["visit"]=&gt;
    array(3) {
      ["common"]=&gt;
      array(4) {
        ["date"]=&gt;
        string(10) "2017-05-13"
        ["hour"]=&gt;
        string(2) "09"
        ["minute"]=&gt;
        string(2) "00"
        ["weather"]=&gt;
        string(5) "sunny"
      }
      [0]=&gt;
      array(6) {
        ["room_id"]=&gt;
        string(2) "33"
        ["did_visit"]=&gt;
        string(2) "on"
        ["bounce_zone"]=&gt;
        string(1) "1"
        ["bounce_reason"]=&gt;
        string(1) "1"
        ["next_action"]=&gt;
        string(1) "2"
        ["memo"]=&gt;
        string(11) "hello world"
      }
      [1]=&gt;
      array(6) {
        ["room_id"]=&gt;
        string(2) "34"
        ["did_visit"]=&gt;
        string(3) "off"
        ["bounce_zone"]=&gt;
        string(1) "0"
        ["bounce_reason"]=&gt;
        string(1) "0"
        ["next_action"]=&gt;
        string(1) "1"
        ["memo"]=&gt;
        string(14) "hello world!!!"
      },
      [2]=&gt;
      array(6) {
        ["room_id"]=&gt;
        string(2) "35"
        ["did_visit"]=&gt;
        string(3) "off"
        ["bounce_zone"]=&gt;
        string(1) "3"
        ["bounce_reason"]=&gt;
        string(1) "2"
        ["next_action"]=&gt;
        string(1) "1"
        ["memo"]=&gt;
        string(14) "hello world!!!"
      }
    }
    ["_token"]=&gt;
    string(40) "2yvZEmM3SUxTcUAZusZs87B1fKD4edVFy0AY4kjC"
  }
  </code></pre>