Skip to content

Add missing payload renormalization for morphDataClass #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MartinPetricko
Copy link

Hey, so I am using abstract data with PropertyMorphableData contract implemented, but when correct data class is resolved, it only contains properties that are defined in that abstract class. This PR fixes that issue by renormalizing payload for correct morphDataClass. It is also a shame that this feature is not documented at all.

@bcorcoran
Copy link

It is documented at https://spatie.be/docs/laravel-data/v4/as-a-data-transfer-object/abstract-data but the behavior you described is not. I just ran into this myself which is how I found the issue.

@bcorcoran
Copy link

@rubenvanassche Any chance you could review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants