Laravel 8 has() {#collection-method}
2021-07-19 09:38 更新
has
方法判断集合中是否存在指定键:
$collection = collect(['account_id' => 1, 'product' => 'Desk', 'amount' => 5]);
$collection->has('product');
// true
$collection->has(['product', 'amount']);
// true
$collection->has(['amount', 'price']);
// false
以上内容是否对您有帮助:
更多建议: