title: Validating Arrays of radio buttons in laravel
body: <p>I am using Laravel 5.1 and homestead.</p>
  
  <p>My issue is when validation fails, the radio buttons do not repopulate with data from the original user's input.</p>
  
  <p>My validation rules from PostRequest.php</p>
  
  <pre><code>public function rules()
      {
          //validating input text field --&gt; this one works
          $rules = ['owner' =&gt; 'required|max:15',];
  
          //validating array of input text fields --&gt; this too works
          foreach($this-&gt;request-&gt;get('item') as $a =&gt; $z)
          {
              $rules['item.'.$a] = 'required';
          }
  
          //validating array of radio buttons --&gt; does not return with data
          foreach($this-&gt;request-&gt;get('radio') as $b =&gt; $y)
          {
              $rules['radio.'.$b] = 'required';
          }
  
  
          return $rules;
      }
  </code></pre>
  
  <p>A segment of my view(blade.php)</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="tcell col-xs-6"&gt;
          &lt;label for="item[0]" class="sr-only"&gt;&lt;/label&gt;
          &lt;input class="form-control" id="item[0]" name="item[0]" type="text" placeholder="enter item" value="{ { old('item.0') } }"/&gt;
      &lt;/div&gt;
      &lt;div class="tcell col-xs-6"&gt;
          &lt;div class="radio"&gt;
              &lt;input type="radio" id="s15" name="radio[0]" value="5" /&gt;&lt;label for="s15" title="5"&gt;5&lt;/label&gt;
              &lt;input type="radio" id="s14" name="radio[0]" value="4" /&gt;&lt;label for="s14" title="4"&gt;4&lt;/label&gt;
              &lt;input type="radio" id="s13" name="radio[0]" value="3" /&gt;&lt;label for="s13" title="3"&gt;3&lt;/label&gt;
              &lt;input type="radio" id="s12" name="radio[0]" value="2" /&gt;&lt;label for="s12" title="2"&gt;2&lt;/label&gt;
              &lt;input type="radio" id="s11" name="radio[0]" value="1" /&gt;&lt;label for="s11" title="1"&gt;1&lt;/label&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
   ...
  
      &lt;div class="tcell col-xs-6"&gt;
          &lt;div class="radio"&gt;
              &lt;input type="radio" id="s20" name="radio[1]" value="5" /&gt;&lt;label for="s20" title="5"&gt;5&lt;/label&gt;
              &lt;input type="radio" id="s19" name="radio[1]" value="4" /&gt;&lt;label for="s19" title="4"&gt;4&lt;/label&gt;
              &lt;input type="radio" id="s18" name="radio[1]" value="3" /&gt;&lt;label for="s18" title="3"&gt;3&lt;/label&gt;
              &lt;input type="radio" id="s17" name="radio[1]" value="2" /&gt;&lt;label for="s17" title="2"&gt;2&lt;/label&gt;
              &lt;input type="radio" id="s16" name="radio[1]" value="1" /&gt;&lt;label for="s16" title="1"&gt;1&lt;/label&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>The old() function worked for both input(text) and array of input(text). but I do not know how to apply it with radio buttons.</p>
  
  <p>Thanks</p>