Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Added values parameter to Builder::firstOrNew #15567

Merged
merged 1 commit into from
Sep 27, 2016
Merged

[5.4] Added values parameter to Builder::firstOrNew #15567

merged 1 commit into from
Sep 27, 2016

Conversation

sebastiandedeyne
Copy link
Contributor

firstOrCreate accepts a $values parameter to immediately merge in default values when returning a new model. This PR adds the same functionality to firstOrNew.

It provides less value than in the case of firstOrCreate, however, it can save you a line of code and it makes sense to have the same signature across the two methods for consistency.

Since this is a signature change, I assume it's breaking and can only be added in 5.4.

@taylorotwell taylorotwell merged commit d3d0411 into laravel:master Sep 27, 2016
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