Verwenden Sie having nach withCount:
$posts = Post::withCount('upvotes') ->having('upvotes_count', '>', 5) ->get();
Verwenden Sie having nach withCount:
$posts = Post::withCount('upvotes') ->having('upvotes_count', '>', 5) ->get();