for laravel code example
Example 1: laravel if syntax
@if (foo)
// do something
@elseif (bar)
// do something else
@else
// do some other thing;
@endif
Example 2: laravel for loop
@for ($i = 0; $i < 10; $i++)
The current value is {{ $i }}
@endfor
@foreach ($users as $user)
This is user {{ $user->id }}
@endforeach
@forelse ($users as $user)
{{ $user->name }}
@empty
No users
@endforelse
@while (true)
I'm looping forever.
@endwhile