Support the ongoing development of Laravel.io →
Views Blade Testing

I tried using

@foreach ($product as $index => $pro)

<td>{{$index+1}} </td>

@endforeach

But every change page, number back to first.. Thank you.

Last updated 2 years ago.
0

Is there a problem if you use the product id? which i suppose you have one in your product table

0

What are you trying to do?

0
{{ $key+1+(($employees->getCurrentPage()-1)*$employees->getPerPage()) }}

Change $key with $index and $employees with your collection

0

Sign in to participate in this thread!

Eventy

Your banner here too?

dekoci dekoci Joined 4 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.