Skip to content

Instantly share code, notes, and snippets.

@bkozora
Created January 5, 2015 15:33
Show Gist options
  • Save bkozora/7c3818b96db45c70393d to your computer and use it in GitHub Desktop.
Save bkozora/7c3818b96db45c70393d to your computer and use it in GitHub Desktop.
Blade - Loops
@for ($i = 0; $i < 10; $i++)
The current value is {{ $i }}
@endfor
@foreach ($users as $user)
<p>This is user {{ $user->id }}</p>
@endforeach
@forelse($users as $user)
<li>{{ $user->name }}</li>
@empty
<p>No users</p>
@endforelse
@while (true)
<p>I'm looping forever.</p>
@endwhile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment