My laravel eloquent is like this :
$products = Product::where(\'status\', 1)
->where(\'stock\', \'>\', 0)
->where(\'category
That's because latest versions of MySQL behave like most dbms already do regarding group by clauses; the general rule is
if you're using
group by, all columns in yourselectmust be either present in thegroup byor aggregated by an aggregation function (sum,count,avgand so on)
Your current query is grouping by store_id, but since you're selecting everything the rule above is not respected.