@while(): operator directive is part of the conditional
loop operator directives. It is being used to loop through a list of item.
@php: $i = 1; @php; // declare $i value
@while($i < 3):
The current number is {{ $i }} <br>
{{: $i++; }}
@endwhile;
The current number is 1
The current number is 2
@php:, we can similarly use the new smart php directive
{{: $i = 1; }} // declare $i value
@while($i < 3):
The current number is {{ $i }} <br>
{{: $i++; }}
@endwhile;