Laravel — P11: Blade Loops
Published in
5 min readDec 23, 2022
Blade directives have proven to be useful in the previous few articles, however, only now will they begin to shine. Loops can look quite messy with PHP when they’re embedded inside of HTML. Blade makes them look nice, almost like they belong there.
Blade has your standard loops, like the for
, foreach
and while
loops, but it also has another one called forelse
.
I’m going to assume that you know about the various different loops in PHP. If you don’t, take a look at my PHP articles on them.