title: How to sort to post by votes in Laravel Queries
body: <p>how can I sort posts by votes in Laravel Queries? I know how to get the count by using <code>-&gt;count()</code> but I don't know how to integrate it while joining other table.</p>
  
  <pre><code>$posts = DB::table('posts')
                  -&gt;join('votes', 'votes.post_id', '=', 'posts.id')
                  -&gt;select('posts.id', 'posts.description', 'posts.user_id', 'posts.created_at')
                  -&gt;where('posts.created_at', '&gt;=', date('Y-m-d H:i:s',time()-86400))
                  -&gt;paginate(10);
  </code></pre>
  
  <p>I don't know how to orderBy vote counts.</p>