zeuxisoo/slim-whoops
Integrates the Whoops error handler with Slim Framework, replacing default error pages with detailed debugging output, stack traces, and a clean interface during development. Install via Composer and register the middleware/provider to get started quickly.
Architecture fit. zeuxisoo/slim-whoops is a thin adapter that wires the filp/whoops error handler into Slim's middleware pipeline. It is not a runtime component of the application architecture — it is a developer-experience layer that renders rich HTML stack traces and code excerpts when an exception is thrown. As such, its architectural footprint is small and its fit is conditional: it belongs in require-dev, registered only when APP_ENV=development. It does not participate in request routing, DI, or business logic, so it imposes almost no structural constraint on the codebase.
Integration feasibility. Composer-only, single dependency (filp/whoops), a few lines to register middleware. The main branch of complexity is Slim version: Slim 3's native middleware signature versus Slim 4's PSR-15 stack. The package has historically been a Slim 3 wrapper; for Slim 4 you either need the PSR-15 variant or — realistically — a ~10-line custom middleware around Whoops directly, which makes the wrapper's value largely evaporate. Whichever path, integration is a half-day task, not a project.
Technical risk. Three concerns dominate:
Key questions.
require-dev, config gate)?Stack fit. Appropriate only for PHP/Slim teams. Value is highest on Slim 3 where it is a genuine drop-in; value drops sharply on Slim 4+, where native addErrorMiddleware plus Whoops directly (or an alternative like Spatie Ignition/symfony/error-handler) covers the same ground with one less dependency.
Migration path. Treat this as an enhancement, not a migration:
require-dev, register conditionally, no production change.filp/whoops directly and write a small PSR-15 middleware; avoid inheriting a stale Slim-3-era wrapper.Compatibility. Pin the package and Whoops to versions verified against the target PHP and Slim version. Require composer.lock discipline so dev machines and CI agree. Confirm autoloading and that the middleware class name matches the installed major version (the Slim 3 and Slim 4 classes differ).
Sequencing.
require-dev only; never require.APP_ENV === 'development'), not implicitly.Maintenance. Low ongoing effort, but not zero: the package and Whoops must be bumped alongside PHP and Slim upgrades. Given the low activity signal, expect periods without upstream releases; budget a small owner to watch it. Total cost of ownership is measured in hours per year, not weeks.
Support. No meaningful upstream support ecosystem (0 dependents, single maintainer). Internal ownership is required — treat it as "vendored in spirit." Documentation should note the fallback (direct Whoops middleware) so any engineer can replace it without research.
Scaling. No runtime scaling implications. It is dev-only and does not execute in production request paths. The only "scale" concern is team-wide rollout: standardizing the env gate and documenting it across services.
Failure modes.
Ramp-up. Near-zero. Any PHP developer can read and modify a single middleware registration. The only onboarding item is the "dev-only, gated" convention.
Recommendation. Adopt narrowly as a dev-only convenience for Slim 3 codebases, with strict environment gating and an explicit owner. For Slim 4+, skip the wrapper and integrate Whoops (or a maintained alternative) directly. Given the low score and dependency signals, do not let it become load-bearing infrastructure.
How can I help you explore Laravel packages today?