1// You may also pass a key / value pair to the contains method,
2// which will determine if the given pair exists in the collection:
3
4$collection = collect([
5 ['product' => 'Desk', 'price' => 200],
6 ['product' => 'Chair', 'price' => 100],
7]);
8
9$collection->contains('product', 'Bookcase');
10// false
1// you may pass a string to the contains method to determine whether
2// the collection contains a given item value:
3
4$collection = collect(['name' => 'Desk', 'price' => 100]);
5
6$collection->contains('Desk');
7// true
8
9$collection->contains('New York');
10// false