简介常用方法mapWithKeys() 方法 简介提供一个更具可读性和更便于处理数组数据的封装。 常用方法 mapWithKeys() 方法遍历集合并将每个值传入给定的回调函数,返回一个包含单个键 / 值对 的关联数组 $keyed = $collection->mapWithKeys(function ($item) { return [$item['email'] => $item['name']];});