K
K
Konstantin Timosheno2019-12-10 08:20:49
Laravel
Konstantin Timosheno, 2019-12-10 08:20:49

Continuing iteration of @foreach loop?

Hi all.
I make a loop in the blade template with a foreach loop , use $loop->iteration for numbering, but since I use paginate in the controller, the numbering starts again when you switch to another page.
How to make it so that when switching, the numbering continues?
Thank you in advance.
PS Maybe the answer is already on the Internet (poke your nose), but I have not found the answer yet.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kokhan, 2019-12-10
@kastembay

$counter = $(your variable)->firstItem();
$counter is then passed to the view and output $counter++

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question