Adding only and except methods #5
Replies: 3 comments 2 replies
-
I think it makes sense to add such methods. What do you think @rubenvanassche ? |
Beta Was this translation helpful? Give feedback.
-
I was kind of looking for the same, I guess a |
Beta Was this translation helpful? Give feedback.
-
@agentphoenix That seems like a great idea! Though it it will take some work to implement, the include and exclude methods allow you to include/exclude lazy properties. You need to also implement the I think It would be really cool if you'd use the ArtistData::from($artist)->only('name', 'songs.title')->toArray(); I'd love to see such a PR! Good luck! |
Beta Was this translation helpful? Give feedback.
-
Really enjoying this library! I'd like to use it to replace my DTOs, but I'm finding that I'm missing the
only
andexcept
methods that your DTO package has.I see that there are
include
andexclude
methods, but it's not clear if that's meant for the same thing in this package.Would you guys be open to a PR adding the
only
andexcept
methods into the package?Beta Was this translation helpful? Give feedback.
All reactions