juststeveking/http-slim
A lightweight Laravel package for slimming HTTP responses, trimming unnecessary headers and overhead so your app returns leaner, cleaner, faster responses with minimal configuration.
Architecture fit
Illuminate\Support\Facades\Http and contributes an "extend one base class per third-party API" shape — base URI, default headers, auth, endpoint methods — plus a consistent response object. Fakes, retries, middleware and fluent requests are all inherited from Laravel, not added.description.md describes a Laravel middleware that strips verbose response headers for bandwidth/fingerprint reasons. The v2.1.0 release notes and both prior assessments describe a PSR-18/PSR-17 HTTP client with php-http/discovery autodiscovery and a php-http/common plugin system. Those are architecturally different packages with different integration surfaces. Until composer.json and src/ are read, any architecture statement here is speculation — including the ones in the package's own listing.Integration feasibility
php-http/discovery, php-http/client-common), the declared php/laravel/framework constraints, whether 4xx/5xx throws or returns a response, whether retry()/timeout() passthrough exists, and how per-request headers merge against class-level defaults.Technical risk
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Laravel 10/11 signature drift → fatal on class load | High | High (deploy-time discovery) | Smoke test instantiating every client + one faked call, run in CI on upgrade PRs |
| Package identity mismatch (client vs. middleware) | Confirmed | Medium (wasted effort) | 30-minute source audit before any code |
| Unmaintained since 2021-08-27; 7 stars, 0 dependents | Certain | Medium–High | Pin 2.1.0 explicitly; written replacement deadline, or fork/vendor |
| Header merge order silently overwrites auth | Medium | High (401s in staging) | Http::assertSent regression test on headers and base URI |
Composer 2.2+ allow-plugins block on discovery |
Medium | Medium (CI friction) | Confirm dependency tree first; pin resolved client in a service provider |
| Failed responses returned rather than thrown | Unknown | Medium | Single handle() helper on our base class; verify in source |
Key questions
composer.json declare?php-http/discovery and php-http/client-common genuinely in the dependency tree, or only in release-note prose?retry()/timeout()?Authorization and a per-request header collide?Stack fit
Http:: calls in controllers and jobs with inconsistent error handling. The package's contribution is a convention that makes integrations reviewable and testable.Migration path
Incremental, single-endpoint first, interface at the seam:
composer require juststeveking/http-slim:2.1.0 into a scratch branch, then read composer.json and src/. Resolve every question in the previous section before writing integration code.:2.1.0, not ^2.1. With no release cadence and no dependents to shake out a bad resolution, an unpinned transitive dependency in the request path is an unmanaged risk.WeatherClientContract) bound in a service provider. Controllers and jobs depend on the interface, never on the package. This is the single decision that makes the dependency cheap to adopt and cheap to abandon.Http::fake(). Explicitly not the integration with auth refresh, pagination and webhooks.Compatibility
rtrim + explicit trailing slash) and header merge order are the two compatibility-sensitive behaviours. Both are covered by a single Http::assertSent assertion, which is the regression test to insist on in code review.config:cache interacts badly with resolving the client as a container-boot singleton — stale base URIs frozen across deploys. Resolve clients per-request; they are cheap.Sequencing
Audit → pin → interface + one client → fake-based test → short internal reference doc → expand to remaining integrations → set and honour a replacement deadline (own the class, drop extends Client, keep the interface). The deadline is part of the plan, not an aspiration.
Maintenance
2.1.0, accept the risk in writing, attach a replacement date; or (b) fork/vendor under app/Support/ (MIT permits it) and drop the Composer dependency entirely. Leaving it unpinned in the request path is not a posture.Support
Http::.Scaling
Failure modes
Authorization default.config:cached with an outdated base URI.allow-plugins prompt blocking an opaque install if php-http/discovery is present.Ramp-up
How can I help you explore Laravel packages today?