Question : Laravel loop with counter
Answered by : good-gibbon-jamj1ro8xtv0
@foreach($rows as $row) <tr> <td>{{ $loop->iteration }}</td> <td>{{ $row->item1}}</td> <td>{{ $row->item2}}</td> </tr> @endforeach
Source : https://www.titanwolf.org/Network/q/a5757da4-9bc6-4932-9bb6-a27fc045548d/y | Last Update : Sat, 02 Oct 21
Question : laravel loop counter
Answered by : irfan-majid
@foreach($items as $key => $item) <tr> <td>{{ $loop->iteration }}</td> //its like serial of row <td>{{ $item->name }}</td> <td>{{ $item->email }}</td> </tr>
@endforeach
Source : | Last Update : Sun, 19 Jun 22