Is there a way to extend data class with additional properties? #204
Answered
by
rubenvanassche
msnegurski
asked this question in
Q&A
-
We have several pretty big data classes (>50 properties) and they differ only by several properties. It would be really cool if there was a way to create base data class for them and just extend it with several properties, instead of having two almost identical classes, but I have no idea how to do it. |
Beta Was this translation helpful? Give feedback.
Answered by
rubenvanassche
Sep 7, 2022
Replies: 1 comment 2 replies
-
This should work, added a test to check it: laravel-data/tests/DataTest.php Lines 2376 to 2387 in 0e87504 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
msnegurski
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should work, added a test to check it:
laravel-data/tests/DataTest.php
Lines 2376 to 2387 in 0e87504