forelse laravel blade code example
Example 1: forelse laravel
@forelse ($users as $user)
<li>{{ $user->name }}</li>
@empty
<p>No users</p>
@endforelse
Example 2: forach in larvel blade
@forelse ($array as $element)
// loop here
@empty
// is empty
@endforelse