You can use RAW DB queries in various places, including havingRaw()
function after groupBy()
.
Product::groupBy('category_id')->havingRaw('COUNT(*) > 1')->get();
Only until Jan 16th: coupon RESOLUTION25 for 40% off Yearly/Lifetime membership!
Read more hereYou can use RAW DB queries in various places, including havingRaw()
function after groupBy()
.
Product::groupBy('category_id')->havingRaw('COUNT(*) > 1')->get();