Replies: 2 comments 1 reply
-
Looks like #5 would be similar |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @innocenzi, At the moment there's no support for this. I think some people are looking into it but I'm not sure. Currently working on data v2 so I've added it on a maybe list(#84) but I really want to get this version released without constantly adding new features 😄 . Feel free to send a PR adding 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
-
Hey,
I'm wondering if there is a nice way to conditionally exclude (or include) properties of a DTO.
In my case, I'm using
laravel-data
together with Inertia, and I'd like to not expose certain properties depending on the authorization level of users. For instance, I don't wantid
to be present most of the times, but I do want them in the admin panel.Is there any way to do that without creating another DTO? I couldn't find anything on the docs. I don't think lazy properties solve the use case because we can force them via URL (and I didn't see a way to disable that), and I'd like to not have to redefine a
from*
method.Ideally, something simple like:
Beta Was this translation helpful? Give feedback.
All reactions