1$collection = collect(['name' => 'Desk', 'price' => 100]);
2
3$collection->contains('Desk');
4
5// true
6
7$collection->contains('New York');
8
9// false
1$collection = collect(['account_id' => 1, 'product' => 'Desk']);
2
3$collection->has('product');
4
5// true
1$collection = collect([1, 2, 3, 4, 5]);
2
3$collection->contains(function ($value, $key) {
4 return $value > 5;
5});
6
7// false