I have a foreach loop and inside that contains html with bootstrap columns.
@foreach($address as $add) <div class="col-md-6"> Some data </div> @endforeach
However, bootstrap requires that a div line be created before creating the columns, and this direct relation to the foreach loop would create a line div for each col-md-6. I want to know how I can throw a div in a line, skip the next loop, casting only the closing div tag. Then repeat this process.
Sample output where loops 4 times:
<div class="row"> <div class="col-md-6"> Some data </div> <div class="col-md-6"> Some data </div> </div> <div class="row"> <div class="col-md-6"> Some data </div> <div class="col-md-6"> Some data </div> </div>
Thomas Charlesworth
source share