From b97a8073f0d3664ff8245c6e5e1bca727a5fe641 Mon Sep 17 00:00:00 2001 From: Hannes Van De Vreken Date: Thu, 17 Sep 2020 19:35:05 +0200 Subject: [PATCH] Properly register binding of psr http client and aliases --- src/Support/Laravel/ServiceProvider.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Support/Laravel/ServiceProvider.php b/src/Support/Laravel/ServiceProvider.php index 9216292..e3af4b9 100644 --- a/src/Support/Laravel/ServiceProvider.php +++ b/src/Support/Laravel/ServiceProvider.php @@ -24,6 +24,7 @@ public function provides(): array return [ Client::class, ClientInterface::class, + PsrClientInterface::class, HandlerStack::class, ]; } @@ -34,12 +35,12 @@ public function provides(): array public function register(): void { // Configuring all guzzle clients. - $this->app->bind(ClientInterface::class, function(): PsrClientInterface { + $this->app->bind(PsrClientInterface::class, function(): PsrClientInterface { // Guzzle client return new Client(['handler' => $this->app->make(HandlerStack::class)]); }); - $this->app->alias(ClientInterface::class, Client::class); + $this->app->alias(PsrClientInterface::class, Client::class); $this->app->alias(PsrClientInterface::class, ClientInterface::class); // Bind if needed.