When you have a Collection let's say:
$posts = Post::where('user_id', 12)->get();
and you want to check if it is not empty do something.
$posts = Post::where('user_id', 12)->get();
if(!$posts->isEmpty()){
dd('true');
}else{
dd('false');
}
also you can use:
if(!$posts->isEmpty())
if($posts->count() > 0)
if($posts->first())
if(count($posts->count()))