sunrise/http-message
Sunrise HTTP Message provides a PSR-7 HTTP message implementation with PSR-17 factories, aligned with RFC-7230. Use it to create and work with requests, responses, URIs, streams, and uploaded files in a standards-compliant way.
zendframework/zend-diactoros, laminas/laminas-http). This aligns with Laravel’s reliance on PSR standards for HTTP handling (e.g., Illuminate\Http\Request, Illuminate\Http\Response).Illuminate\Http components (e.g., Request, Response, Stream) are PSR-7 compatible, so this package can seamlessly integrate as a drop-in replacement or extension.JsonRequest/UrlEncodedRequest implementations align with Laravel’s common request parsing needs (e.g., API payload handling).Symfony\Component\HttpFoundation/FileBag) and log processing.symfony/http-foundation or zendframework/zend-diactoros), as the package is PSR-focused and avoids framework-specific abstractions.symfony/http-client or guzzlehttp/psr7, but these are typically used for HTTP clients, not message construction.zend-diactoros) for critical paths like request/response serialization.Illuminate\Http\UploadedFile) are not replicated here, but the package can complement Laravel’s existing stack rather than replace it entirely.zend-diactoros) entirely, or supplement it (e.g., for stream handling)?Request, Response) that could benefit from this package’s extensions (e.g., JsonRequest)?Illuminate\Pipeline) and service containers?symfony/http-foundation or guzzlehttp/psr7 if both are loaded?new \Zend\Diactoros\Request() with new \Sunrise\HttpMessage\Request().JsonRequest for API payloads instead of manually parsing JSON.FileStream and LineStream classes can improve file handling in Laravel’s Storage facade or custom upload logic.RequestFactory, ResponseFactory) can be injected into Laravel’s service container via AppServiceProvider:
$this->app->bind(\Psr\Http\Message\RequestFactoryInterface::class, \Sunrise\HttpMessage\RequestFactory::class);
Illuminate\Pipeline) will work unchanged.Request or Stream) in a non-critical module (e.g., a custom API controller).Http facade and middleware.zend-diactoros for sunrise/http-message in composer.json:
"require": {
"sunrise/http-message": "^3.0",
"zendframework/zend-diactoros": null
}
AppServiceProvider to use Sunrise implementations.app/Http/Middleware, app/Console/Commands).JsonRequest, LineStream) in critical paths.v3.4.0+).spatie/array-to-xml, fruitcake/laravel-cors) will remain unaffected.zend-diactoros may need updates (unlikely, as PSR-7 is the standard).JsonRequest/UrlEncodedRequest work with Laravel’s Route::json() and Route::post().FileStream for custom file upload logic (e.g., app/Http/Controllers/FileUploadController).zend-diactoros in a staging environment.Sunrise’s API (e.g., JsonRequest vs. Laravel’s json() helper).LineStream with Laravel’s logging").sunrise/http-message support, requiring internal troubleshooting.zend-diactoros, but stack traces may differ.SunriseHttpMessageServiceProvider with error handling middleware to catch PSR violations early.writeStream()) could improve large-file handling in Laravel’s Storage system.How can I help you explore Laravel packages today?