Laravel 8 whereNull() {#collection-method}
2021-07-19 10:01 更新
whereNull
方法筛选给定键为 NULL 的项:
$collection = collect([
['name' => 'Desk'],
['name' => null],
['name' => 'Bookcase'],
]);
$filtered = $collection->whereNull('name');
$filtered->all();
/*
[
['name' => null],
]
*/
以上内容是否对您有帮助:
更多建议: