Skip to content

[9.x] Eloquent: firstWhere returns Object instead of NULL#41099

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
marvinrabe:patch-1
Feb 18, 2022
Merged

[9.x] Eloquent: firstWhere returns Object instead of NULL#41099
taylorotwell merged 1 commit into
laravel:9.xfrom
marvinrabe:patch-1

Conversation

@marvinrabe

@marvinrabe marvinrabe commented Feb 18, 2022

Copy link
Copy Markdown
Contributor

Fixes #41098

@marvinrabe marvinrabe changed the title Eloquent: firstWhere returns Object instead of NULL [9.x] Eloquent: firstWhere returns Object instead of NULL Feb 18, 2022
@driesvints

Copy link
Copy Markdown
Member

This definitely isn't wanted and changes the behavior of this method to accept more parameters than needed.

@driesvints driesvints closed this Feb 18, 2022
@driesvints driesvints reopened this Feb 18, 2022

@driesvints driesvints left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm this fixes the issue for me as well. @marvinrabe can you maybe also add a test?

@taylorotwell taylorotwell merged commit a803bfd into laravel:9.x Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eloquent: firstWhere returns wrong result when passing an operator as value

3 participants