check if there a empty collection laravel 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: collection empty laravel
$isempty = $collection->isEmpty();