You can use RAW DB queries in various places, including havingRaw()
function after groupBy()
.
1Product::groupBy('category_id')->havingRaw('COUNT(*) > 1')->get();
You can use RAW DB queries in various places, including havingRaw()
function after groupBy()
.
1Product::groupBy('category_id')->havingRaw('COUNT(*) > 1')->get();