1 year ago

I wanna get all articles with votes

Posted 1 year ago by SmokeTM

I try to get all articles with a certain amount of votes. In this case 5. Someone knows how to do that?

  $articles = Article::with('user', 'categorie', 'comments', 'votes')
            ->withCount('votes', 'cryptoVotes')
            ->where('created_at', '<=', Carbon::now()->subHour(1))
            ->where('sum(crypto_votes_count)', '>', 5)

Please sign in or create an account to participate in this conversation.