API Resource is a transformation layer. if you don't want to output eloquent models 1:1.
the data wrapping is also a plus, if you want to output previous/next... links and/or some other metadata in the result
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am new on using Laravel api things. I'm trying to understand what's the differece between api resources and eloquent native collection results. It's not clear yet for me. I'm using postman to analyze data but I can't see huge diffrenece. As far as I see api resources just wrap with data tag all datas.. :) Most probably it's not like that. If someone guide me about the differences and advantages, I'll be so glad. Thank you.
API Resource is a transformation layer. if you don't want to output eloquent models 1:1.
the data wrapping is also a plus, if you want to output previous/next... links and/or some other metadata in the result
Please or to participate in this conversation.