pull方法

把给定键对应的值从集合中移除并返回。

$collection = collect(['product_id' => 'prod-100', 'name' => 'Desk']);

$collection->pull('name'); // 'Desk'

$collection->all(); // ['product_id' => 'prod-100']
Copyright © http://blog.webfsd.com 2018 all right reserved,powered by Gitbook该文件修订时间: 2019-05-21 04:55:26

results matching ""

    No results matching ""