loops in blade laravel code example
Example 1: how to write for loop in laravel blade
<div>
@for ($i = 0; $i < $max; $i++) //Where $max is whatever you need as break condition.
<p>{{ $i }}</p> //This would print $i in a paragraph. You do whatever you need here.
@endfor
</div>
Example 2: forach in larvel blade
@forelse ($array as $element)
// loop here
@empty
// is empty
@endforelse