title: Laravel 5.6 DB::RAW count()
body: <p>How do I count the number of rows in <code>score</code> column where score is less than 50?</p>
  
  <pre><code> $user = DB::table('users')
   -&gt;leftJoin('rankings', 'rankings.user_id', '=', 'users.id')
   -&gt;select('users.*', DB::raw("(  (count(rankings.score)  ) )  as `countBelow50` ")
  </code></pre>