[8.x] Add whereNot() and orWhereNot() to query builders#36522
[8.x] Add whereNot() and orWhereNot() to query builders#36522shadoWalker89 wants to merge 1 commit intolaravel:8.xfrom
Conversation
|
Thanks for your pull request to Laravel! Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include. If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions! If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response. |
|
@taylorotwell Hi 😄
So it's only logical to add the simple |
|
I agree, it would be cleaner. doing : all the time. it's more of a syntactic sugar than anything |
|
@lk77 I'm actually using this for negating a group of wheres where not ( condition and condition and condition and condition ) |
|
@taylorotwell Is there any chance for this to get reconsidered? We've run into use-cases for this multiple times since we first saw this a month ago, and I'm sure we're not alone about that. |
This PR adds two new methods
whereNot()andorWhereNot()to the Query builder and the Eloquent Query builderThis PR comes with tests
Usage example