I have this array of object and I need to remove the key "0" :
"images": [
{
"0": "http://example.test/uploads/products/jqGfPyIUc_Wd.jpg"
},
{
"0": "http://example.test/uploads/products/bC1UIM5WwT8f.jpeg"
}
],
my code:
'images' => $this->images->map(function($item){
return (object)[$item->image_path];
}),
I need to remove the keys and keep it as an array like this:
"images": [
{
"http://example.test/uploads/products/jqGfPyIUc_Wd.jpg"
},
{
"http://example.test/uploads/products/bC1UIM5WwT8f.jpeg"
}
],