Replies: 3 comments
-
Well, you can make it a little shorter: @foreach(range(0, 9) as $i)
The current value is {{ $i }}
@endforeach |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The current PHP style syntax for a loop is ugly and verbose. If we could use @repeat instead of @for and pass an integer value of the number of times to loop, it would make our code more readable and slightly quicker to write
@repeat(10)The current value is {{ $loop->index }}@endrepeatinstead of
@for ($i = 0; $i < 10; $i++)The current value is {{ $i }}@endforBeta Was this translation helpful? Give feedback.
All reactions