Skip to content

Conversation

@ganyicz
Copy link
Contributor

@ganyicz ganyicz commented Sep 6, 2021

This PR unifies the behavior of firstOr method on relationships which override the first method.

Unlike every other firstOrX method, the firstOr method doesn't handle the relationship query result as you would expect. Eg. using BelongsToMany, you don't get the pivot attribute because the call is forwarded to the base builder.

@GrahamCampbell GrahamCampbell reopened this Sep 6, 2021
@GrahamCampbell GrahamCampbell changed the title Add firstOr methods to relationship classes [9.x] Add firstOr methods to relationship classes Sep 6, 2021
@taylorotwell taylorotwell merged commit 75969f7 into laravel:master Sep 8, 2021
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.

3 participants