Array
(
[0] => Array
(
[name] => 412
)
[1] => Array
(
[name] => 3144
)
[2] => Array
(
[name] => 632
)
)
$arr = [['name' => 412], ['name' => 3144], ['name' => 632]];
$new_arr = array_combine(range(1, count($arr)), array_values($arr));
var_dump($new_arr);
/*
array(3) {
[1]=>
array(1) {
["name"]=>
int(412)
}
[2]=>
array(1) {
["name"]=>
int(3144)
}
[3]=>
array(1) {
["name"]=>
int(632)
}
}
*/
$collection = collect([['name' => 412], ['name' => 3144], ['name' => 632]]);
$collection = $collection->prepend(0, '-1')->values()->except(0);