berlioz/http-message
berlioz/http-message offers PSR-7 compliant HTTP message classes for PHP: immutable requests, responses, URIs, streams, and uploaded files. It works seamlessly with Laravel and other frameworks, giving developers a clean, standards-based foundation for handling HTTP requests and responses.
berlioz/http-message is a framework-free PSR-7/PSR-17 implementation (HttpFactory implements all six PSR-17 factory interfaces). It lets us make a portability decision — "our request/response objects are PSR-compliant regardless of whether we run Laravel, Symfony, Slim, or raw PHP" — rather than a framework-vendor decision.Consider it when:
Look elsewhere when:
nyholm/psr7, guzzlehttp/psr7, laminas/laminas-diactoros) dominate for a reason.Illuminate\Http (requests/responses) is the natural fit; this package adds value only at the interop boundary.To executives: This is a cheap, MIT-licensed interoperability layer, not a platform bet. It lets our services and shared libraries exchange HTTP messages in a standards-compliant way, so we aren't locked into one framework's request/response objects. The strategic value is optionality — cheaper framework migrations, reusable SDKs, and consistent test fixtures. The strategic risk is provenance: it's a very small, single-maintainer project. Recommendation: treat it as an evaluation/pilot candidate behind our own interface, not a critical-path dependency, and keep a mainstream PSR-7 implementation as the fallback. Cost of trying it is low; cost of depending on it blindly is not.
To engineering: Framework-free PSR-7/PSR-17 implementation; one factory class covers all six PSR-17 interfaces via traits, plus pluggable body parsers and specialized streams. It's PHP 8.2+, MIT, and lives in the wider Berlioz monorepo (so upstream releases move in step with the framework). Two asks before adoption: (1) wrap it behind an internal HttpMessageFactory port so we can swap to nyholm/psr7 with a one-line binding change, and (2) run it through our existing controller/middleware and client test suites for parity on streams, multipart bodies, and header edge cases.
Decision framing: Approve a time-boxed pilot in one internal library or SDK. Success criteria: passes parity tests, no stream/body-parser regressions, and the internal abstraction holds. If it fails or maintenance stalls, the fallback is a drop-in mainstream implementation at effectively zero product cost.
How can I help you explore Laravel packages today?