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.7] Add whereNotBetween method to Collection #27028

Merged
merged 2 commits into from Jan 2, 2019

Conversation

Projects
None yet
2 participants
@Te7a-Houdini
Copy link
Contributor

Te7a-Houdini commented Jan 1, 2019

this PR adds whereNotBetween to collection object , since we have whenEmpty & whenNotEmpty , whereIn & whereNotIn , i thought that whereNotBetween method should be added to collection object as a convention

$collection = collect([
    ['product' => 'Pencil', 'price' => 30],
    ['product' => 'Chair', 'price' => 80],
    ['product' => 'Door', 'price' => 100],
    ['product' => 'Bookcase', 'price' => 150],
   ['product' => 'Desk', 'price' => 200],
]);

$filtered = $collection->whereNotBetween('price', [100, 200]);

$filtered->all();

/*
    [
        ['product' => 'Bookcase', 'price' => 30],
        ['product' => 'Bookcase', 'price' => 80],
    ]
*/

Te7a-Houdini added some commits Jan 1, 2019

@taylorotwell taylorotwell merged commit 87cf8f1 into laravel:5.7 Jan 2, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment