This method agroups rows to summarize.
public function groupBy(string $column1, string $column2, ...): self; public function groupBy(array $columns): self; public function groupBy(string $sql): self;
PHP's way:
$repository->groupBy('user_id', 1);
SQL's Representation:
GROUP BY user_id, 1
$repository->groupBy([ 'brand_id', 'category_id', ]);
GROUP BY brand_id, category_id
$repository->groupBy('customer_id, CAST(created_at AS DATE)');
GROUP BY customer_id, CAST(created_at AS DATE)
🡄 Grouped Conditions | Having 🡆
There was an error while loading. Please reload this page.
Home