40continue laravel

Solutions on MaxInterview for 40continue laravel by the best coders in the world

showing results for - " 40continue laravel"
Lara
05 May 2019
1## When using loops you may also end the loop or skip the current iteration
2## using the @continue and @break directives:
3
4@foreach ($users as $user)
5    @if ($user->type == 1)
6        @continue
7    @endif
8
9    <li>{{ $user->name }}</li>
10
11    @if ($user->number == 5)
12        @break
13    @endif
14@endforeach
15  
16## You may also include the continuation or break condition within the 
17## directive declaration:
18
19@foreach ($users as $user)
20    @continue($user->type == 1)
21
22    <li>{{ $user->name }}</li>
23
24    @break($user->number == 5)
25@endforeach