How can I limit an @foreach? I use a foreach to show the data of a related table and I would like to limit the results of that foreach I try to use this but it gives me error
{{$count = 0;}} @foreach($product->post as $produc) {{if($count == 4) break; }}
///contenido
{{$count++;}}
Any ideas?