GroupBy
Trait GroupBy.
Tags
Table of Contents
- groupBy() : static
- Appends columns to the GROUP BY clause.
- groupByAsc() : static
- Appends columns with the ASC direction to the GROUP BY clause.
- groupByDesc() : static
- Appends columns with the DESC direction to the GROUP BY clause.
- renderGroupBy() : string|null
- Renders the GROUP BY clause.
Methods
groupBy()
Appends columns to the GROUP BY clause.
public
groupBy(Closure|string $column, Closure|string ...$columns) : static
Parameters
- $column : Closure|string
-
The column name or a subquery
- $columns : Closure|string
-
Extra column names and/or subqueries
Return values
static —groupByAsc()
Appends columns with the ASC direction to the GROUP BY clause.
public
groupByAsc(Closure|string $column, Closure|string ...$columns) : static
Parameters
- $column : Closure|string
-
The column name or a subquery
- $columns : Closure|string
-
Extra column names and/or subqueries
Return values
static —groupByDesc()
Appends columns with the DESC direction to the GROUP BY clause.
public
groupByDesc(Closure|string $column, Closure|string ...$columns) : static
Parameters
- $column : Closure|string
-
The column name or a subquery
- $columns : Closure|string
-
Extra column names and/or subqueries
Return values
static —renderGroupBy()
Renders the GROUP BY clause.
protected
renderGroupBy() : string|null
Return values
string|null —The GROUP BY clause or null if it was not set