1$collection = collect([
2 ['name' => 'Sally'],
3 ['school' => 'Arkansas'],
4 ['age' => 28]
5]);
6
7$flattened = $collection->flatMap(function ($values) {
8 return array_map('strtoupper', $values);
9});
10
11$flattened->all();
12
13// ['name' => 'SALLY', 'school' => 'ARKANSAS', 'age' => '28'];