Skip to content

Array of Data objects serialisation fails for array properties #826

Answered by rubenvanassche
ana28p asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ana28p

This is expected behavior, calling toArray transforms everything into an array even data objects (that's how Laravel works). You better use all() in such cases.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ana28p
Comment options

Answer selected by ana28p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants