laravel collection wherenotin

Solutions on MaxInterview for laravel collection wherenotin by the best coders in the world

showing results for - "laravel collection wherenotin"
Victoria
28 Jan 2020
1$collection = collect([
2    ['product' => 'Desk', 'price' => 200],
3    ['product' => 'Chair', 'price' => 100],
4    ['product' => 'Bookcase', 'price' => 150],
5    ['product' => 'Door', 'price' => 100],
6]);
7
8$filtered = $collection->whereNotIn('price', [150, 200]);
9
10$filtered->all();
11
12/*
13    [
14        ['product' => 'Chair', 'price' => 100],
15        ['product' => 'Door', 'price' => 100],
16    ]
17*/