laravel hide if empty code example
Example 1: laravel check collection not empty
if ($mentor->first()) { }
if (!$mentor->isEmpty()) { }
if ($mentor->count()) { }
if (count($mentor)) { }
if ($mentor->isNotEmpty()) { }
Example 2: laravel check if object empty
@if(!$contacts->isEmpty())
//do something
@else
You dont have contacts
@endif