Laravel 5.4 array remove key index

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.

$res = [];
foreach ($finalRegions  as $key => $value) {
    $res[] = $value;
}

// $res contains desired result

I still don’t get why you need to remove those indexes, but you can do by this way.

<?php

$jsonArr = '{  
   "0":{  
      "id":1,
      "name":"Alaska",
      "image_x":227,
      "image_y":117
   },
   "1":{  
      "id":5,
      "name":"Australian Antartic Territory",
      "image_x":1187,
      "image_y":1037
   }
}';

$decodeArr = json_decode($jsonArr, true);
print_r(json_encode($decodeArr));

This is just my idea, and you can edit part of your code where the query returns your JSON string.