laravel each continue loop code example

Example: @continue laravel

## When using loops you may also end the loop or skip the current iteration
## using the @continue and @break directives:

@foreach ($users as $user)
    @if ($user->type == 1)
        @continue
    @endif

    <li>{{ $user->name }}</li>

    @if ($user->number == 5)
        @break
    @endif
@endforeach
  
## You may also include the continuation or break condition within the 
## directive declaration:

@foreach ($users as $user)
    @continue($user->type == 1)

    <li>{{ $user->name }}</li>

    @break($user->number == 5)
@endforeach

Tags:

Php Example