symfony/psr-http-message-bridge
Symfony PSR-7 Bridge integrates PSR-7 HTTP messages with Symfony’s HttpFoundation. Convert requests and responses between PSR-7 implementations and Symfony components to ease interoperability with middleware and libraries.
Illuminate\Http\Request and Illuminate\Http\Response extend Symfony’s HttpFoundation components, which this package bridges to PSR-7. This creates a seamless integration path for Laravel applications needing PSR-7 compliance without rewriting core HTTP logic.symfony/http-foundation, and this package extends its functionality without introducing new dependencies. The bridge operates as a drop-in layer between Laravel’s HTTP stack and PSR-7.Request/Response and PSR-7 interfaces, ensuring backward compatibility while enabling PSR-7 integrations.Response and PSR-7 ResponseInterface for API consistency.nyholm/psr7) for unit/integration tests.Cookie and UploadedFile classes differ slightly from PSR-7’s CookieJarInterface and UploadedFileInterface. The bridge handles conversions, but custom logic (e.g., partitioned cookies or large file streams) may require validation.ServerRequest (extending Symfony\Component\HttpFoundation\Request) is not a PSR-7 ServerRequestInterface. Middleware expecting strict PSR-7 compliance may fail.Psr7ToHttpFoundationConverter and HttpFoundationToPsr7Converter explicitly in middleware or HTTP clients.psr/http-message) may conflict with Laravel’s composer constraints.composer.json constraints post-integration; use platform-check or why-not to detect conflicts.Strategic Alignment:
Use Case Clarity:
Middleware Strategy:
invoke() method?Testing Impact:
nyholm/psr7)? How will this bridge affect test coverage and mocking strategies?MockHttpRequest) need updates to leverage PSR-7 interfaces?Maintenance and Support:
symfony/http-foundation?Performance and Scaling:
Dependency Management:
psr/http-message version mismatches) with Laravel’s ecosystem?symfony/http-foundation, making this bridge a natural extension rather than a disruptive change.HttpClient (Guzzle-based) with PSR-18 clients, standardizing HTTP calls across the application.Psr\Http\Message\ServerRequestInterface).symfony/http-foundation).illuminate/http version aligns with the bridge’s Symfony requirements.psr/http-message) and optionally PSR-15 (psr/http-server-middleware) for middleware.psr/log, psr/http-client).composer require symfony/psr-http-message-bridge
psr/http-message is installed (usually a dependency of Laravel).How can I help you explore Laravel packages today?