Skip to content

Instantly share code, notes, and snippets.

@msurguy
Forked from JeffreyWay/example.html
Last active June 23, 2017 19:02
Show Gist options
  • Save msurguy/9401567 to your computer and use it in GitHub Desktop.
Save msurguy/9401567 to your computer and use it in GitHub Desktop.
Using array_chunk to wrap a number of DOM elements in another DOM element such as a div
@foreach(array_chunk($posts, 3) as $postSet)
<div class="row"> <!-- this div will surround every three posts -->
@foreach($postSet as $post)
<h3>{{ $post['title'] }}</h3>
@endforeach
</div>
@endforeach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment