Answers for "how to get the index in foreach loop in laravel"

PHP
0

how to get the index in foreach loop in laravel

@foreach ($items as  $item)
{{ $loop->index }}
@endforeach
Posted by: Guest on June-07-2021
2

loop index foreach laravel

@foreach ($teams as $key => $team)
{{ str_ordinal($key + 1) }}
@endforeach
Posted by: Guest on February-07-2021

Code answers related to "how to get the index in foreach loop in laravel"

Browse Popular Code Answers by Language