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.8] Fix insertOrIgnore() and insertUsing() as Eloquent queries #29645

Merged
merged 1 commit into from
Aug 20, 2019
Merged

[5.8] Fix insertOrIgnore() and insertUsing() as Eloquent queries #29645

merged 1 commit into from
Aug 20, 2019

Conversation

staudenmeir
Copy link
Contributor

When being called as an Eloquent query, insertOrIgnore() and insertUsing() return the query builder instead of the actual result (number of affected rows / success):

User::insertOrIgnore(['foo' => 'bar']);

User::insertUsing(['foo'], "select 'bar'");

@taylorotwell taylorotwell merged commit b449e0e into laravel:5.8 Aug 20, 2019
@staudenmeir staudenmeir deleted the eloquent-insert branch August 20, 2019 01:31
@tw99
Copy link
Contributor

tw99 commented Aug 21, 2019

@staudenmeir With the addition of insertOrIgnore does that mean Laravel would accept a PR for upsert?

@staudenmeir
Copy link
Contributor Author

@tw99 Please ask Taylor about that.

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