http-interop/http-factory-guzzle
This package provides a PSR-17 HTTP factory implementation using guzzlehttp/psr7. It’s meant as a compatibility bridge for projects still on Guzzle 1.x (which lacks a built-in factory), but note: since guzzlehttp/psr7 v2.0+ includes a built-in factory (GuzzleHttp\Psr7\HttpFactory), this package is now largely deprecated. First check whether your project already depends on guzzlehttp/psr7:^2.0; if so, use the official factory instead. If stuck on ^1.x, install this package:
composer require http-interop/http-factory-guzzle
Then use it to create PSR-7/17 objects:
use Http\Factory\Guzzle\Factory;
$factory = new Factory();
$request = $factory->createRequest('GET', 'https://example.com');
$response = $factory->createResponse(200);
Http\Factory\Guzzle\Factory as a shared service for PSR-17 interfaces (Psr\Http\Message\RequestFactoryInterface, etc.). Laravel developers can bind it in a service provider:
$this->app->singleton(RequestFactoryInterface::class, Factory::class);
guzzlehttp/psr7:^2.0 and still need factory methods for PSR-7/17 objects.guzzlehttp/psr7 v2+ provides a better-supported official factory. Prefer that—this package is effectively unmaintained (last release: July 2021) and adds little value now.guzzlehttp/psr7:^1.7 or ^2.0, but for Guzzle 2.x (which is extremely rare today), you’ll need legacy branches—avoid if possible.guzzlehttp/psr7 is installed and the correct version (>=1.7) is loaded.guzzlehttp/psr7 usage. If indirect dependency pins old versions, update or use composer require guzzlehttp/psr7:^2.0 --with-all-dependencies carefully.How can I help you explore Laravel packages today?