Is there a way to use DTO instead of Eloquent model as record in Resources?

At the moment the whole model with every field available is exposed into the front-end. Is there a way to limit the exposure by using DTO or any other method to just sent filtered array with data for the display that's actually needed?
2 Replies
Dennis Koch
Dennis Koch2y ago
You can reduce fields by using ->select() on the query, but I think that’s it.
Crylar
CrylarOP2y ago
I will try, might work thanks 🙂
Want results from more Discord servers?
Add your server