data-transfer-object
data-transfer-object copied to clipboard
Enable object with MapTo properties to be cloned (Fix #272)
This PR adds a flag to ignore the MapTo attribute. In some cases, it could be useful to get the original keys instead of the mapped ones when you export a data object to an array. This is also the easiest way to fix the bug in issue #272 as we can just pass true for the $keepOrginalKeys flag and don't walk into any array merging issues.
With the default value of false we also don't risk any breaking changes. If the flag is not passed, we get the same behavior as right now.
Thanks for the PR, @gerpo. What's the use case for this outside of fixing #272?
Could this be merged in? This is blocking us from cloning a DTO with multiple MapTo
props.
We are stopping maintenance on this package.
Consider migrating to spatie/laravel-data or cuyz/valinor