Support the ongoing development of Laravel.io →
Database Blade
Last updated 1 year ago.
0
Solution

You should group results by 'kind' field or change foreach

@foreach($animals as $i=>$animal) 

and use an if

@if($i>0 && $animals[$i-1]->kind != $animal->kind)
0

Sign in to participate in this thread!

Eventy

Your banner here too?

elker elker Joined 17 May 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.