Is there an easy way to change the format that the ORM returns data with on a ->get()
At the moment, it returns ["1" : {}. "2: : {}] etc and I just need a simple array of objects like [{}, {}, {}]
I'm aware that I can just process the data before returning but it would be cleaner if there was another way.
Thanks!
The ORM's get() returns an array of Model objects.
In case of numeric PK's, the array index is equal to the PK, which allows you to access results directly on PK value without looping over the result array.
This is intentional and by design.
If you want a simple indexed array, use array_values() to convert the result.