Laravel 8 pull() {#collection-method}
2021-07-19 09:44 更新
pull
方法把指定键对应的值从集合中移除并返回:
$collection = collect(['product_id' => 'prod-100', 'name' => 'Desk']);
$collection->pull('name');
// 'Desk'
$collection->all();
// ['product_id' => 'prod-100']
以上内容是否对您有帮助:
更多建议: