Answers for "laravel collection flip"

PHP
0

laravel collection flip

$collection = collect(['name' => 'taylor', 'framework' => 'laravel']);

$flipped = $collection->flip();

$flipped->all();

// ['taylor' => 'name', 'laravel' => 'framework']
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language