blog-contest-may-mayhem
blog-contest-may-mayhem copied to clipboard
APIs The Eloquent Way - A Package To Consume Third Party APIs Like A Database. Models, Relations, Method Chaining And More
https://blackbits.io/blog/apis-the-eloquent-way
Interesting subject. For the Active Record part, if you did not already, you should read this series of posts
This is a really interesting take on a problem I've also tried to tackle.
I approached it slightly differently, using a kind of Eloquent Model (called a Resource) that's been adapted to replace calls to a DB with a generic GuzzleHttp client instance.
I haven't quite tackled all of the areas of concern that this covers though. Plus it feels much nicer to be able to distinguish which API client-model combo is the target by declaring it explicitly during invocation... that would make working with multiple APIs a lot easier!
Great work!
https://i.imgur.com/M7FFyuW.gif
Very nice Work!