Use eager loaded relations to determine whether or not to show conditional properties of a JSON Resource #151
jamiethorpe
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
@jamiethorpe can you please share some code examples of how exactly your controllers (I guess) looks like? I'm interested in the part of how you load relationships, so I can ship this feature! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, conditional properties of a JSON Resource will either display or not display
Required
if they use methods likewhenLoaded
. I think it would be a great idea to take this a step further and check the controller to see if any relations are eager loaded. If they are, the docs would compare that to the properties using thewhenLoaded
method and only display the ones that match. This would make the docs much easier to read from the perspective of the developer consuming them.Beta Was this translation helpful? Give feedback.
All reactions