Answers for "laravel collection check if number exists in array"

PHP
0

laravel check if item is in collection

// you may pass a string to the contains method to determine whether
// the collection contains a given item value:

$collection = collect(['name' => 'Desk', 'price' => 100]);

$collection->contains('Desk');
// true

$collection->contains('New York');
// false
Posted by: Guest on January-14-2021

Code answers related to "laravel collection check if number exists in array"

Browse Popular Code Answers by Language