spiral/nyholm-bridge
Spiral Framework bridge to Nyholm PSR-7/PSR-17 implementations. Install via Composer and enable NyholmBootloader to swap out the default Diactoros HTTP bootloader for Nyholm factories and message objects.
composer require spiral/nyholm-bridge
app/config/app.php or via bootstrapping logic), importing Nyholm’s factories into Spiral’s DI container:
use Nyholm\Psr7\Factory\Psr17Factory;
use Spiral\NyholmBridge\NyholmBridge;
$bridge = new NyholmBridge(new Psr17Factory());
$bridge->register($app);
Psr\Http\Message\ServerRequestInterface or Psr\Http\Message\ResponseFactoryInterface and let the bridge handle instantiation.ServerRequestInterface or return ResponseInterface from Nyholm using type-hinted factories.Psr17Factory implementations, enabling predictable HTTP mocking.ringcentral/psr7, slimphp/Slim-Psr7) safely — Nyholm is battle-tested and lightweight, reducing incompatibility risks.Psr17Factory is registered (Nyholm) to prevent inconsistent message instances.Spiral\Http\Request) — the bridge overrides these only after registration. Ensure it’s registered early in the container setup.NyholmBridge; it doesn’t auto-discover or fallback silently.^1.5+), and confirm PHP version support (tested up to 8.1 at time of release).How can I help you explore Laravel packages today?