refactor(model)!: Allow groupBy to accept multiple args instead an array
This commit is contained in:
@@ -892,14 +892,14 @@ class Model
|
|||||||
/**
|
/**
|
||||||
* Defines GROUP BY in the SQL statement.
|
* Defines GROUP BY in the SQL statement.
|
||||||
*
|
*
|
||||||
* @param array $arr
|
* @param array $columns
|
||||||
* Columns to group by.
|
* Columns to group by.
|
||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function groupBy(array $arr): static
|
public static function groupBy(string ...$columns): static
|
||||||
{
|
{
|
||||||
static::$querySelect['groupBy'] = join(', ', $arr);
|
static::$querySelect['groupBy'] = join(', ', $columns);
|
||||||
return new static();
|
return new static();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user