Laravel

Laravel adding numbers from foreach loop when count variable is supplied?

Pinterest LinkedIn Tumblr
@foreach ($data as $index => $value)
   {{$index}} - {{$value['name']}}
@endforeach

Above Example print from 0 if you want print from 1 than add 1.

Example: {{$index + 1}}

Write A Comment