hasokeric
6/13/2013 - 5:06 AM

Limit a foreach with Laravel blade

Limit a foreach with Laravel blade

@foreach (array_slice($posts->toArray(), 0, 5) as $post)

  <h1>{{ $post['title'] }}</h1>

@endforeach