I have a laravel application thT fetches API data from 2 different providers, they are different but will have similar data albeit in a different structure.
I’m trying to figure out how I can best make this as easy to maintain as possible in laravel.
Let’s say the data they send me are orders (order1Api, order2Api) with products but in a different structure.
I want to fetch them and convert them in a class that have a similar structure.
So I would need 2 classes to handle fetching the order dat for the seperate APIs and the. I need 1 Model to make the data uniform?
I’m still learning laravel so am not sure if the APIs should be a service or facade Where could I best place the order so that I’m able to fetch data from them in different controllers if needed?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire