eugenezadorin / airtable-php

Simple PHP client for Airtable API
19 stars 7 forks source link

Laravel integration #3

Open eugenezadorin opened 2 years ago

eugenezadorin commented 2 years ago

It will be extra package containing Laravel service provider, I guess.

mathieutu commented 5 months 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?

eugenezadorin commented 3 months ago

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!