php-http/guzzle7-adapter
PSR-7/PSR-18 adapter for Guzzle 7 used by HTTPlug. Lets libraries using PHP-HTTP talk through Guzzle 7 with a standard client interface, including synchronous requests and integration-friendly configuration for modern PHP projects.
Install via Composer: composer require php-http/guzzle7-adapter. This package provides a PSR-18 compliant HTTP client wrapper for Guzzle 7, allowing interoperability with libraries expecting PSR-18 clients (e.g., Laravel’s http() client, Symfony HttpClientBridge, or third-party SDKs). Start by resolving the client via the container: app(\Psr\Http\Client\ClientInterface::class)—it will automatically resolve to the Guzzle 7 adapter. Use it like any PSR-18 client: $response = $client->sendRequest($request); (where $request is a PSR-7 request).
Guzzle7Adapter as the default PSR-18 client by adding Http\Adapter\Guzzle7\Client in config/app.php’s providers (for older Laravel) or via service provider binding in AppServiceProvider. Alternatively, rely on Laravel’s built-in http() helper (which uses this adapter under the hood if configured).\Psr\Http\Client\ClientInterface into services to avoid direct Guzzle dependencies, enabling easier testing with PSR-18 mocks.GuzzleHttp\Client.requestAsync() with custom options, handlers, or request builders), you must resolve the underlying GuzzleHttp\Client separately or maintain a separate Guzzle dependency.http() middleware stack if using Laravel.Mockery::mock(\Psr\Http\Client\ClientInterface::class) with proper return types). Laravel’s Http::preventStrayRequests() works seamlessly with this setup.php-http/curl-client), ensure only one PSR-18 client binding exists to avoid ambiguity in dependency injection.How can I help you explore Laravel packages today?