📅  最后修改于: 2022-03-11 14:54:38.346000             🧑  作者: Mango
$collection = collect([1, 2, 3, 4, 5]);
$collection->transform(function ($item, $key) {
return $item * 2;
});
$collection->all();
// [2, 4, 6, 8, 10]