阅读(3222)
赞(0)
Laravel 8 combine() {#collection-method}
2021-07-01 14:27:49 更新
combine
方法将一个集合的值作为键,与另一个数组或集合的值进行结合:
$collection = collect(['name', 'age']);
$combined = $collection->combine(['George', 29]);
$combined->all();
// ['name' => 'George', 'age' => 29]