Laravel/PHP Articles

Articles from Laravel/PHP sites on the web

Laravel/PHP Articles
When I work with APIs, I usually create a single PHP class which is responsible for sending the Guzzle HTTP request. It usually looks like this: <?php namespace App\Services\IMDB; use GuzzleHttp\Client; use GuzzleHttp\Psr7\Response; class HttpClient { public function send(array $payload) : Response { return app(Client::class) ->request('POST', 'https://api.example.com/movies', $payload); } } I don't write Unit Tests for such a simple class, but I will write Integration Tests to cover the feature, which will trigger the class in some way or another. When I want to test how my app reacts ...

Sign Up For Our Newsletter

Each Week, We curate the top Laravel/PHP articles, jobs, events and More!

We'll send you a weekly email with the latest Laravel/PHP articles, jobs and events. Please review our Code of Conduct in the meantime. Talk to you soon!