@unless (count($items))
<p>Unfortunately, no items were returned.</p>
@endunless
Handling Empty Paginated Collections
So I am having a problem. To start, my skill level is probably not as advanced as many users here so sometimes even little things that may seem obvious give me some grief.
I am grabbing some DB results from a query and paginating them from the controller. I want to show some sort of feedback to the user if no results were returned from their search. The problem is when I dump the variable, I am returning a Illuminate\Pagination\LengthAwarePaginator Object and all of the properties are protected so I clearly can't access them.
So, my question is, what kind of conditional do you use to check if a collection returned 0 results in a view so you can give feedback to the user?
Please or to participate in this conversation.