I have an array like this
Array
(
[0] => Array
(
[title] => first
[description] => first item
)
[1] => Array
(
[title] => second
[description] => second item
)
)
And remove an item from the array using collection forget() method
$new = collect($arr);
$new->forget(0);
echo json_encode($new->all());
Here is the json output of the above
{"1":{"title":"second ","description":"second item"}}
But i am expecting a json like this
[{"title":"second ","description":"second item"}]
Also how can i re index the above array after applying forget() method??