If I dd($items);
in the controller, the result like this :
In the view blade laravel I check if collection empty like this :
@if($items)
...
@endif
But it does not work
How can I solve this problem?
You could use $items->isEmpty(); or $items->isNotEmpty();
Like so:
@if(!$items->isNotEmpty())
...
@endif
You can further read over here: https://laravel.com/docs/5.5/collections#method-isempty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With