Answers for "laravel check key collect object exists"

PHP
1

laravel check collection has key

$collection = collect(['account_id' => 1, 'product' => 'Desk', 'amount' => 5]);

$collection->has('product');

// true

$collection->has(['product', 'amount']);

// true

$collection->has(['amount', 'price']);

// false
Posted by: Guest on March-01-2021

Code answers related to "laravel check key collect object exists"

Browse Popular Code Answers by Language