Open eugenezadorin opened 2 years ago
Hey! Thanks for your package. Actually, the service provider is not much to do, but one thing that's too bad is using curl directly, and not a PSR18/Guzzle client. It would allow mocking the api calls, and tracking the call made in Laravel and Telescope.
WDYT?
Hi! Sorry for long time response.
I need some research here. I'm agree, that it will be more flexible solution to use replaceable and standartized http client here, while keeping lightweight default client.
So it may look like that:
// third parameter is optional and allows any psr18-compatible client
$client = new Airtable\Client($apiKey, $database, new GuzzleHttp\Client());
Another option is using some auto-discovery - https://github.com/php-http/discovery - but I need some closer look here.
Thanks for your feedback and stay tuned!
It will be extra package containing Laravel service provider, I guess.