-
-
Save rowej83/bbf8172177ba23c71de2 to your computer and use it in GitHub Desktop.
array_chunk() usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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