Laravel 8 values() {#collection-method}
2021-07-19 09:52 更新
values
方法返回键被重置为连续编号的新集合:
$collection = collect([
10 => ['product' => 'Desk', 'price' => 200],
11 => ['product' => 'Desk', 'price' => 200],
]);
$values = $collection->values();
$values->all();
/*
[
0 => ['product' => 'Desk', 'price' => 200],
1 => ['product' => 'Desk', 'price' => 200],
]
*/
以上内容是否对您有帮助:
更多建议: