Skip to content

[13.x] Allow closure values in HasOneOrManyThrough::firstOrNew() and updateOrCreate() - #62361

Closed
KalimeroMK wants to merge 1 commit into
laravel:13.xfrom
KalimeroMK:fix/has-one-or-many-through-closure-values
Closed

KalimeroMK wants to merge 1 commit into
laravel:13.xfrom
KalimeroMK:fix/has-one-or-many-through-closure-values

Conversation

@KalimeroMK

Copy link
Copy Markdown
Contributor

Follow-up to #59647, which added Closure support to firstOrNew() and updateOrCreate() on Builder, HasOneOrMany, and BelongsToMany.

HasOneOrManyThrough already accepts Closure|array $values in firstOrCreate(), createOrFirst(), restoreOrCreate(), and createOrRestore(), while firstOrNew() and updateOrCreate() still only accept array. This updates both methods on HasOneOrManyThrough to accept Closure|array $values and resolve $values via value().

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.

2 participants