I create a view by doing an eloquent query and then pass it over to Blade.
@if($contacts != null)
//display contacts
@else
You dont have contacts
@endif
However it always assume that $contacts has something even if the query gives me nothing.
I did dd($contacts)
and get:
Collection {#247 ▼
#items: []
}
How do I check if it is empty?
count($contacts) > 0
on PHP 7.2+ – Babbittry