Mysql
 SQL >> Datenbank >  >> RDS >> Mysql

WHERE-Bedingung bei Laravel withCount anwenden

Verwenden Sie having nach withCount:

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