title: Laravel get most popular product
body: <p>Im having 2 tables one with products and one favourit to keep it simple i show the relevant rows.</p>
  
  <p><strong>table poducts</strong></p>
  
  <p>id</p>
  
  <hr>
  
  <p><strong>table favourit</strong></p>
  
  <p>user_id <em>not needed in query</em></p>
  
  <p>product_id</p>
  
  <hr>
  
  <p>What i want is find the top 10 of products wich are most common in the favourit table. I think i have to do</p>
  
  <pre><code>   favourit::groupBy(product_id) 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>   favourit::orderBy(ammount(sum of all product_ids), desc)
  </code></pre>
  
  <p>But how can i get the ammount(sum of all product_ids) to order by? Also would this query (with a groupby) be possible to be joined with the products table so i get the products in one query?</p>