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.5] Add whereKeyNot to Eloquent Builder #20817

Merged
merged 1 commit into from
Aug 29, 2017
Merged

[5.5] Add whereKeyNot to Eloquent Builder #20817

merged 1 commit into from
Aug 29, 2017

Conversation

antonkomarev
Copy link
Contributor

@antonkomarev antonkomarev commented Aug 29, 2017

This PR introduces inverse method of the whereKey named whereKeyNot.

I've found it useful to write:

$query->whereKeyNot($id);

Instead of:

$query->where($this->getKeyName(), '!=', $id);

Implemented exactly as whereKey. It accepts single id, array of ids and collections.

@antonkomarev antonkomarev changed the title Add whereKeyNot to Eloquent Builder [5.5] Add whereKeyNot to Eloquent Builder Aug 29, 2017
@taylorotwell taylorotwell merged commit 21f4d19 into laravel:master Aug 29, 2017
@antonkomarev antonkomarev deleted the feature/eloquent-builder-where-key-not branch August 29, 2017 19:27
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.

None yet

2 participants