Home

Published

- 1 min read

foreach empty laravel

img of foreach empty laravel

The solution for this is noted below

foreach empty laravel

Solution

   @forelse($status->replies as $reply)
    <p>{{ $reply->body }}</p>
@empty
    <p>No replies</p>
@endforelse
  
Check the documentation for the best result:  
http://laravel.com/docs/5.1/blade#control-structures

Try other methods by searching on the site. That is if this doesn’t work