psr/http-server-middleware
PSR-15 HTTP server middleware interfaces for PHP. Provides the MiddlewareInterface specification used by request handlers and middleware stacks; no implementation included. Install via psr/http-server-middleware and use with compatible frameworks or libraries.
This package enables framework-agnostic middleware development, allowing seamless integration across PHP ecosystems (Laravel, Symfony, Slim, etc.). It supports strategic build vs buy decisions by leveraging a standardized interface instead of custom solutions, reducing development time and ensuring compatibility with existing middleware libraries. Key use cases include building reusable security, logging, or API gateway components that work across multiple frameworks without framework-specific code, and accelerating adoption of third-party middleware in multi-framework environments.
Adopt when building middleware for cross-framework compatibility, contributing to open-source libraries targeting the broader PHP community, or integrating third-party middleware into a framework that supports PSR-15 (e.g., via bridges). Avoid when developing framework-specific middleware (e.g., pure Laravel middleware using native middleware system), if the target environment lacks PSR-15 support and bridging is impractical, or when advanced features beyond the standard interface (e.g., complex
How can I help you explore Laravel packages today?