Hey guys, I am going to use Laravel for the front-end of a project which offers a REST API for communicating with the back-end. I was wondering if there are any best practices on how to deal with consuming REST APIs. I know about the HTTP client, but I was wondering if I should use service provider for example for every API endpoint. Also, how do I deal with the response entities, do I just write my own classes and fill them based on the JSON data I receive from the API? Any hints on how to approach this scenario would be helpful.
Hello, Sebastian! You can use Guzzle http client with repository pattern. I think wich you don't need create de entities. I hope helped you.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community