In my controller, this statement generates an array:
// sort the region collection by continent for faster access in front end
$finalRegions = $regions->sortBy('continent_id');
{
"0":{
"id":1,
"name":"Alaska",
"image_x":227,
"image_y":117
},
"1":{
"id":5,
"name":"Australian Antartic Territory",
"image_x":1187,
"image_y":1037
....
}
}
How do I remove the index from the resulting object, so it looks like this:
[
{
"id":1,
"name":"Alaska",
"image_x":227,
"image_y":117
},
{
"id":5,
"name":"Australian Antartic Territory",
"image_x":1187,
"image_y":1037
....
}
]
This is stored in a field cast as json
in the table class.