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