-
-
Save robertnicjoo/ff4b06dfb03a68c60bb446b1d200c716 to your computer and use it in GitHub Desktop.
Limit a foreach with Laravel blade
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_slice($posts->toArray(), 0, 5) as $post) | |
<h1>{{ $post['title'] }}</h1> | |
@endforeach |
Author
robertnicjoo
commented
Feb 18, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment