Array of Data objects serialisation fails for array properties #826
-
Hello, I'm having issue with the data serialization after upgrading to version 4. In the controller I'm using
I tried The issue might be that at some point a property of the data object is set as array from a collection of other data objects (e.g. Here is a small replication of the issue (using
Laravel Data: 4.7.1 It passes with
With v3, this works fine. Is this a bug or is the behaviour intended? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ana28p This is expected behavior, calling |
Beta Was this translation helpful? Give feedback.
Hi @ana28p
This is expected behavior, calling
toArray
transforms everything into an array even data objects (that's how Laravel works). You better useall()
in such cases.