Personally I use them for an internal api consumed by react. It makes it easy for me to specify exactly what I need in react app. I also makes it quick to get an overview of what my controllers return.
Oct 27, 2019
5
Level 3
API resources or Eloquent models?
Hi,
I have been reading about this concept of API resources and how they are often used to create external API. My question is when should I stop returning Eloquent models and start using API resources?
Is it only for external APIs ?
Can I use Eloquent Models for internal APIs?
If I mainly use blade views for creating visual layer and only sprinkle a little bit of Vue js, do I need to rely on internal API?
I am asking - what is the general rule of thumb and where/what scenarios to use each or both?
Thanks
Please or to participate in this conversation.