Level 88
Yeah, you need to create multiple resources for that ;)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi Everyone, I had a query. If a need to have two different version (say one with name & id and another with name, id, xyz etc) of API Resource for the same model, do I need to create two different Resources for the same model? I can only see one method toArray() inside an API Resource.
Please or to participate in this conversation.