Laravel collection converts array to object
The issue is that the filter() method does not rekey the underlying collection array. So, the Collection is still representing an array, it is just that your array looks like this: [ 4 => Object4, 7 => Object7, ] While this is a perfectly valid array in PHP, this is not a proper array in … Read more