title: How can I solve incompatible with sql_mode=only_full_group_by in laravel eloquent?
body: <p>My laravel eloquent is like this :</p>
  
  <pre><code>$products = Product::where('status', 1)
              -&gt;where('stock', '&gt;', 0)
              -&gt;where('category_id', '=', $category_id)
              -&gt;groupBy('store_id')
              -&gt;orderBy('updated_at', 'desc')
              -&gt;take(4)
              -&gt;get();
  </code></pre>
  
  <p>When executed, there exist error like this :</p>
  
  <blockquote>
    <p>SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1
    of SELECT list is not in GROUP BY clause and contains nonaggregated
    column 'myshop.products.id' which is not functionally dependent on
    columns in GROUP BY clause; this is incompatible with
    sql_mode=only_full_group_by (SQL: select * from <code>products</code> where
    <code>status</code> = 1 and <code>stock</code> > 0 and <code>category_id</code> = 5 group by <code>store_id</code>
    order by <code>updated_at</code> desc limit 4)</p>
  </blockquote>
  
  <p>How can I solve it?</p>