loophp/unaltered-psr-http-message-bridge-bundle
Symfony bundle bridging PSR-7 HTTP messages without altering them. Converts between PSR-7 requests/responses and Symfony HttpFoundation safely, preserving headers, body streams, and URIs—useful when integrating PSR-7 middleware or clients in Symfony apps.
Request/Response objects without modifying query parameters, aligning well with Laravel’s PSR-15 middleware stack (via symfony/http-foundation bridge). However, Laravel’s native Illuminate\Http\Request/Response are not PSR-7 compliant by default, requiring explicit integration.Request object extends Symfony\Component\HttpFoundation\Request, which already has a PSR-7 bridge (symfony/http-foundation-bridge). This package may be redundant unless query parameter preservation is critical for a specific workflow (e.g., API gateways, proxy services).Illuminate\Http\Request to PSR-7 Psr\Http\Message\RequestInterface for PSR-15 middleware processing, then revert to Laravel’s format downstream.Bridge component, but explicit binding may be needed.psr/http-message (^1.0), symfony/http-foundation (^5.0|^6.0), and symfony/dependency-injection (^5.0|^6.0).symfony/http-foundation-bridge may conflict; dependency resolution must ensure no version clashes.symfony/http-foundation-bridge. Justification for adoption must address specific query parameter requirements.symfony/http-foundation-bridge alters query parameters in ways this package avoids?symfony/http-foundation version?Kernel middleware stack if wrapped in a PSR-15 middleware adapter (e.g., league/route or brick/route).HttpFoundation bridge, so existing Symfony components (e.g., HttpClient) will integrate seamlessly.symfony/http-foundation-bridge instead of introducing a new dependency.php-http/dispatcher or league/route for broader compatibility.composer.json:
"require": {
"loophp/unaltered-psr-http-message-bridge-bundle": "^1.0"
}
platform or conflict constraints.// Example: Convert Laravel Request to PSR-7 for PSR-15 middleware
$psrRequest = (new UnalteredBridge())->toPsr7($request);
$response = $psr15Middleware->process($psrRequest, $handler);
$laravelResponse = (new UnalteredBridge())->toHttpFoundation($response);
$client = new GuzzleClient();
$psrRequest = (new UnalteredBridge())->toPsr7($request);
$response = $client->sendRequest($psrRequest);
$this->app->bind(\Psr\Http\Message\RequestInterface::class, function ($app) {
return (new UnalteredBridge())->toPsr7($app->make(\Illuminate\Http\Request::class));
});
?foo[bar]=baz).?query=hello%20world).?query=foo&query=bar).request()->input()).Illuminate\Http\Request or symfony/http-foundation-bridge that could affect the bridge.dd() or var_dump() to inspect PSR-7 ↔ Laravel conversions.+ vs. %20 in queries).symfony/http-foundation could halt deployment.composer why-not to diagnose conflicts pre-integration.How can I help you explore Laravel packages today?