Skip to content

PR #53209 changes aggregations with group-by #53581

Closed
@rikvdh

Description

@rikvdh

Laravel Version

11.33.0

PHP Version

8.3.14

Database Driver & Version

MariaDB

Description

The behavior is changed in PR #53209. I've built queries in my application which I need further on. But now the behavior changed for aggregate-functions like: min(...), max(...).

When having joins and aggregations with custom selects from joined tables I've seen other issues producing invalid SQL queries due to the subquery existing and columns not existing outside the subquery. But I cannot make an isolated testset and the query is too big.

Steps To Reproduce

in 11.32.0:

Model::groupBy('field')->min('column');

returns int.

in 11.33.0:

Model::groupBy('field')->min('column');

returns collection.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions