Laravel Blade $loop: Auto-increment Numbers in Pagination?

preview_player
Показать описание
Did you know about the $loop object in Blade @foreach loop? And how can you calculate the current iteration number? Let me show you.

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

loop variable is a new knowledge for me. Thanks for the video

rahulraveendran
Автор

{{ $tasks->firstItem() + $loop->index }} Same result

essamal_agamy
Автор

hi laravel daily thank you for this video i think this
$loop -> firstiteam() + $loop ->index () is so easy to do this task 🙄

giveaway
Автор

Excelente video como siempre Máster saludos desde Ecuador

smithaviles
Автор

Usually, i will declare use $index = $tasks->firstItem() before foreach and $index++ for row numbering. it is not recommended approach?

rmartzStudio
Автор

My question is different I hope you answer.
How can we add image to incoming request e.g
If we want to add name to $request we will do something like this $request->name='polvis';
So how can we do the same for image asume that my I have the path of image to merge

mohammadimranmir
Автор

Did you know how to get "normal" pagination as previously been in Laravel, with page numbers...I see that only has the previous and next pages. I am mostly worked in API so didn't see that frontend changed if you have monolith app :)

stojankukrika
Автор

Why you just add key variable in foreach loop? I dont understand.

cfrcabbarl
Автор

Why not just do {{ $loop->index + 1 }}

brianochieng
Автор

I would have used ol with a CSS counter

Hatecultist