Open tanthammar opened 4 years ago
A nice idea.
You could perhaps try to make the HTTP part generic, that way you could perhaps push the lib of your choice into fortie and limiting the amount of dependencies.
I think at the time I wrote this I was most comfortable with guzzle - I'm not entirely sure why I decided to bring it in.
Also, what I thought about now when re-reading this is that the project should not be dependent on Laravel so that it can be used in non-Laravel projects. I'm writing up some kind of generic solution to this now, where the default client is Guzzle (because it's Guzzle=)) but at the same time allowing someone to define their own client implementation as well based on any HTTP implementation.
Yes, good idea to move Laravel related code to another library dependent on this. I use this library in a Symfony project and it works just fine (although the Guzzle client would rather be injected than created in a constructor).
Yep, should definitely be injected.
Fun fact:
Tested to connect to Fortnox api with Laravel 7 new Http::client. Might be of interest for someones fork or for future updates.
This works very well:
Other nice features: https://laravel.com/docs/master/http-client#making-requests
If you run into cURL error 56 on mac os, I had to
brew update && brew upgrade
+php v 7.4.1