How to implement nested data based on polymorphic relationships? #146
-
Hello, I am struggling with a little problem at the moment. Given the scenario of a Model like At the moment, I am doing something like:
As the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I don't see any problems in this case, though I would create a dedicated |
Beta Was this translation helpful? Give feedback.
I don't see any problems in this case, though I would create a dedicated
OwnerData
object which can be created both fromComme t
andPost
. Then you could do something likeOwnerData::from($video->targetable)
which looks nice 😄