refactor(model)!: Allow groupBy to accept multiple args instead an array

This commit is contained in:
kj
2025-10-27 10:25:03 -03:00
parent b2672ad92f
commit d030e8d30e

View File

@@ -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();
} }