mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
633 B
633 B
| title | tweet_id | thread_slug | author_username | images | created_at | slug | |
|---|---|---|---|---|---|---|---|
| Use the $loop variable in Blade foreach loops to access metadata about the loop | 1461703837916405761 | weekly-thread-2021-46 | alexjgarrett |
|
2021-11-19T14:32:06+00:00 | use-the-loop-variable-in-blade-foreach-loops-to-access-metadata-about-the-loop |
A handy $loop object is available in Laravel Blade foreach loops. Super useful for controlling output based on the loop position ➰
Source dive for reference: https://github.com/laravel/framework/blob/8.x/src/Illuminate/View/Concerns/ManagesLoops.php