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

[6.x] Add wherePivotNotIn and orWherePivotNotIn methods #30671

merged 3 commits into from Nov 25, 2019


Copy link

mailbel commented Nov 24, 2019

The main goal of this PR is to add more convenience.

Similar to what is done in Illuminate\Database\Query\Builder with whereNotIn and orWhereNotIn, I added 2 methods called wherePivotNotIn and orWherePivotNotIn.
I did it in exactly the same way whereNotIn and orWhereNotIn are built.

Instead of a call like:


with this PR, developers could use


Basically, $post->wherePivotIn('flag',['foo','bar'],'and',true); will be called behind the scenes.

I also added tests for both methods. Besides, since I could not find any test for the orWherePivotIn method which was already part of the framework before this PR, I added a test for this method also.

Based on the contribution guide, I assumed it was a minor feature fully backward compatible since the added methods are new Laravel API methods which are not referenced anywhere else in the framework. That's why I pushed it to the latest stable branch. If you prefer to have it on the master branch, please let me know.

Also, if the PR is accepted, please let me know if you want to mention wherePivotNotIn in the documentation. I couldn't find orWherePivotIn in the documentation, so I guess there is no need to add orWherePivotNotIn either.

mailbel and others added 3 commits Nov 24, 2019
Ismail E
@taylorotwell taylorotwell merged commit c684bb3 into laravel:6.x Nov 25, 2019
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed
kennith added a commit to kennith/docs that referenced this pull request Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.