title: Check box issue in laravel
body: <p>I have check box inside a foreach loop so that i want to checkbox checked.</p>
  
  <pre><code>&lt;?php
      $heads = TCG\Voyager\Models\Head::all();
      $i=0;                                 
      foreach($heads as $heads){
          $headvalues=explode(',',$test-&gt;reporting_head);
          echo $headvalues[$i]; 
          echo '&lt;br&gt;';
          echo $heads-&gt;id;
  ?&gt;
  &lt;input type="checkbox"  name="check_list[]" value="{{$heads-&gt;id}}_{{$heads-&gt;email}}" &lt;?php echo (($headvalues[$i]==$heads-&gt;id)? 'checked' : ''); ?&gt;&gt;&lt;label&gt;{{$heads-&gt;headname}}&lt;/label&gt;
  &lt;?php 
          $i++;
      }
  ?&gt;
  </code></pre>
  
  <p>Here echo <strong>$headvalues[$i]</strong> are 1, 2 ,3 and echo <strong>$heads->id</strong> are 1,3,2.so i want to checked all this check boxes but now only one check box is checked.i think my logic has issue.I tried the following </p>
  
  <pre><code>&lt;?php echo (($headvalues[$i]==$heads-&gt;id)? 'checked' : ''); ?&gt;
  </code></pre>
  
  <p>Please help me</p>