title: Divide a foreach loops of 23 entries into two divs
body: <p>I have an array with 23 objects in them that I would like to loop through and generate checkboxes for a form. Using Laravel, I came up with this:</p>
  
  <pre><code>{{ Form::open(['url' =&gt; 'panel/update/games', 'id' =&gt; 'ajax']) }}
  
  
      &lt;div class="row"&gt;
  
          &lt;div class="col-sm-6"&gt;
  
              @foreach($data['stats'] as $stats =&gt; $stat)
  
  
                  {{ Form::checkbox('stats', $stat-&gt;Field) }} {{ $stat-&gt;Field }} &lt;br&gt;
  
  
              @endforeach
  
          &lt;/div&gt;
  
      &lt;/div&gt;
  
  {{ Form::button('Update Statistics', ['type' =&gt; 'submit', 'class' =&gt; 'btn btn-info btn-block', 'data-after' =&gt;
  'Updated Statistics|check']) }}
  
  
  {{ Form::close() }}
  </code></pre>
  
  <p>This works well; it generates 23 different checkboxes however, I would like to divide these results into two columns using bootstrap 3's responsive grid. So the data should look like this:</p>
  
  <pre><code>&lt;div class="row"&gt;
    &lt;div class="col-sm-6&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
    &lt;/div&gt;
    &lt;div class="col-sm-6&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
      &lt;input type="checkbox" value="" name=""&gt;
    &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>A <code>print_r</code> on <code>$data['stats']</code>:</p>
  
  <pre><code>Array
  (
  [0] =&gt; stdClass Object
      (
          [Field] =&gt; Username
          [Type] =&gt; varchar(30)
          [Null] =&gt; NO
          [Key] =&gt; PRI
          [Default] =&gt; 
          [Extra] =&gt; 
      )
  
  [1] =&gt; stdClass Object
      (
          [Field] =&gt; Prestige
          [Type] =&gt; int(2)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 1
          [Extra] =&gt; 
      )
  
  [2] =&gt; stdClass Object
      (
          [Field] =&gt; Level
          [Type] =&gt; int(3)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 1
          [Extra] =&gt; 
      )
  
  [3] =&gt; stdClass Object
      (
          [Field] =&gt; Experience
          [Type] =&gt; int(10)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [4] =&gt; stdClass Object
      (
          [Field] =&gt; Points
          [Type] =&gt; int(10)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [5] =&gt; stdClass Object
      (
          [Field] =&gt; Kills
          [Type] =&gt; int(10)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [6] =&gt; stdClass Object
      (
          [Field] =&gt; Deaths
          [Type] =&gt; int(10)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [7] =&gt; stdClass Object
      (
          [Field] =&gt; TeamWins
          [Type] =&gt; int(10)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [8] =&gt; stdClass Object
      (
          [Field] =&gt; TeamLosses
          [Type] =&gt; int(10)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [9] =&gt; stdClass Object
      (
          [Field] =&gt; Bonus
          [Type] =&gt; float
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 1
          [Extra] =&gt; 
      )
  
  [10] =&gt; stdClass Object
      (
          [Field] =&gt; AchievementScore
          [Type] =&gt; int(10)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [11] =&gt; stdClass Object
      (
          [Field] =&gt; Demented
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 1
          [Extra] =&gt; 
      )
  
  [12] =&gt; stdClass Object
      (
          [Field] =&gt; Volatile
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [13] =&gt; stdClass Object
      (
          [Field] =&gt; Undead
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [14] =&gt; stdClass Object
      (
          [Field] =&gt; Scavenger
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [15] =&gt; stdClass Object
      (
          [Field] =&gt; Divinity
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [16] =&gt; stdClass Object
      (
          [Field] =&gt; Withered
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [17] =&gt; stdClass Object
      (
          [Field] =&gt; Killswitch
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [18] =&gt; stdClass Object
      (
          [Field] =&gt; Precise
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [19] =&gt; stdClass Object
      (
          [Field] =&gt; Adept
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [20] =&gt; stdClass Object
      (
          [Field] =&gt; Utility
          [Type] =&gt; int(1)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; 0
          [Extra] =&gt; 
      )
  
  [21] =&gt; stdClass Object
      (
          [Field] =&gt; Class
          [Type] =&gt; varchar(15)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; warrior
          [Extra] =&gt; 
      )
  
  [22] =&gt; stdClass Object
      (
          [Field] =&gt; Perk
          [Type] =&gt; varchar(15)
          [Null] =&gt; NO
          [Key] =&gt; 
          [Default] =&gt; demented
          [Extra] =&gt; 
      )
  </code></pre>
  
  <p>)</p>