Did you know the Blade @each
directive can help cleanup loops in your templates?
1// good 2@foreach($item in $items) 3 <div> 4 <p>Name: {{ $item->name }} 5 <p>Price: {{ $item->price }} 6 </div> 7@endforeach 8 9// better (HTML extracted into partial)10@each('partials.item', $items, 'item')
Tip given by @kirschbaum_dev