Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

what is forelse in laravel

ForElse is a ForEach loop, but with extra handling for empty array.
  
@forelse ($users as $user)
    <li>{{ $user->name }}</li>
@empty
    <p>No users</p>
@endforelse
 
PREVIOUS NEXT
Tagged: #forelse #laravel
ADD COMMENT
Topic
Name
3+1 =