Source: barryvanveen.nl

Laravel Blade @each directive

Category: Laravel

The relatively unknown @each function in a very powerful way to loop over data in Laravel Blade templates. It is powerful and much more elegant than @foreach. Suppose you want to loop over all comments on your article. You would probably write something like this:
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners