yiisoft/middleware-dispatcher
A PSR-15 middleware dispatcher for Yii applications. Build and execute middleware pipelines with lazy resolution through the DI container, fallback request handlers, and support for individual middleware or grouped stacks. Integrates cleanly with Yii's request handling and the PSR-7/PSR-15 ecosystem...
Pipeline/Kernel) or written against the PSR-15 interface. That is a real architecture decision, not a library choice.Consider it when:
Illuminate\Pipeline.Look elsewhere when:
For executives: This is not a product feature; it is a small, permissively licensed (BSD-3-Clause) plumbing library that standardizes how HTTP middleware is composed. The strategic value is interoperability — it would let us write request-handling logic once and run it across different PHP frameworks and runtimes, rather than duplicating it per framework. The risk is concentrated: it is a young, low-adoption package (roughly 17 stars) maintained by a single community, with no commercial support. My recommendation is not to adopt it as a production dependency for our Laravel services, where the framework already provides an equivalent and better-integrated mechanism. It is worth a short evaluation spike only if we commit to a cross-framework middleware strategy, in which case we should treat it as code we may need to own.
For engineering: PSR-15 is the right contract, and this is a clean, minimal implementation of it. In a Laravel codebase, adopting it means stepping outside the HTTP kernel — you lose middleware groups, priority ordering, terminable middleware, and the testing ergonomics that come with the framework. Only do that if portability across PSR-15 runtimes is an explicit requirement. If it is, pin the version, review the source (it is small enough to read end-to-end in an afternoon), and plan for the possibility of vendoring or forking. Do not build product logic that depends on its specific behaviors without tests that lock those behaviors down. And if the real goal is "our middleware should be reusable," the cheaper move is often to depend on the PSR-15 interfaces and keep our own dispatcher, rather than take on this package's maintenance trajectory.
How can I help you explore Laravel packages today?