@gilbert
To loop through a collection in Laravel using foreach, you can do the following:
1
|
$items = Item::all(); |
1
|
return view('your_view', compact('items')); |
1 2 3 |
@foreach($items as $item) {{ $item->name }} @endforeach |
This will loop through each item in the collection and print out the item's name.