Replies: 1 comment
-
This doesn't look like an issue with the package, try taking a at the ModelNormalizer as a start why the property is not included |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
✏️ Describe the bug
I've been stuck on this the past few hours and unable to make any headway into solving it. I'm getting an error with a single model and getting the following
The code that doesn't work
The code that does work for another model
I can however get this to work by adding
toArray()
I was planning on using nested Data Objects with constructor promotion so I can't call
->toArray()
.I am utterly confused and stumped, I've debugged as far as I can, going so far as to looking into how
DataFromArrayResolver
worksThe
createData()
inDataFromArrayResolver
only return an$id
property which explains the null values, but why is that only returning an ID? So back we go toResolvedDataPipeline
L42If I
dump($properties)
before and after this, it returns only an ID afterThat's pretty much as far as I got and still don't have an answer as to why this one particular model requires
->toArray()
I've tried to include all the information possible, if you need more please let me know.
✅ Expected behavior
I expect to not need to call
->toArray()
when it should handle this model automatically.🖥️ Versions
Laravel: 11.37.0
Laravel Data: 4.11.1
PHP:8.4
Beta Was this translation helpful? Give feedback.
All reactions