middlewares/utils
Common utilities for Middlewares PSR packages: auto-discovered PSR-7/PSR-17 Factory (Diactoros, Guzzle, Slim, Nyholm, Sunrise) plus PSR-15 Dispatcher for testing, callable handler helpers, and HTTP error exceptions.
Dispatcher class, which simplifies mocking and validation of middleware stacks without requiring full framework integration.HttpErrorException, improving consistency in API/error handling across microservices or monolithic apps.Dispatcher.CallableHandler.Dispatcher for unit/integration tests.For Executives: "This package standardizes how our PHP/Laravel applications create HTTP requests/responses and chain middleware, reducing technical debt and improving consistency. It’s like using a single, battle-tested factory for Lego blocks—no more arguing over Diactoros vs. Guzzle. For APIs and microservices, it ensures errors are handled uniformly, and for developers, it speeds up testing and debugging middleware logic. Low risk (MIT license, 50+ stars), high reward for maintainability."
For Engineers:
"If you’re tired of configuring PSR-7/PSR-17 factories manually or dealing with Diactoros/Guzzle conflicts, this package auto-detects your preferred libraries and provides a clean API. The Dispatcher class lets you test middleware stacks in isolation, and HttpErrorException gives you structured error responses out of the box. It’s a drop-in solution for any PSR-15 middleware project—just composer require middlewares/utils and start saving time on boilerplate."
How can I help you explore Laravel packages today?