Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Http Slim Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package is best understood as a convention layer, not a capability layer. It sits on top of Laravel's 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.
  • That means the buy-vs-build comparison is not "vendor SDK vs. package." It is "this thin base client vs. an internal abstract class we write in an afternoon." The internal class wins on ownership almost every time; the repo's real value is as a reference implementation of a pattern we should standardise anyway.
  • Published signals conflict, and that is the first thing to resolve. 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

  • Mechanically trivial: MIT licensed, Composer-installable, small surface area, no infrastructure. A single Laravel engineer can prototype against one endpoint in under a day.
  • The gating work is audit, not integration: confirm the actual dependency tree (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.
  • Zero-config auto-discovery is asserted in the description but is unverified and, if real, introduces nondeterministic transport resolution — the resolved PSR-18 client can differ from what config intends with no code change on our side.

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

  1. Which package is this actually — header-stripping middleware, or a PSR-18 client wrapper? What does composer.json declare?
  2. Are php-http/discovery and php-http/client-common genuinely in the dependency tree, or only in release-note prose?
  3. Does a 4xx/5xx throw or return? Does the client expose retry()/timeout()?
  4. Which header wins when a class default Authorization and a per-request header collide?
  5. Who internally owns this code if upstream never ships again?
  6. Is there a foreseeable need for transport portability (swap PSR-18 client), or is staying on Laravel's client an acceptable long-term posture?

Integration Approach

Stack fit

  • Laravel-only. The value proposition is entirely inherited from Laravel's HTTP client semantics, so there is no case for adopting it in a Symfony, vanilla PHP, or mixed-framework estate — a direct PSR-18 client would be the correct choice there.
  • Strong fit where integration code today is scattered raw Http:: calls in controllers and jobs with inconsistent error handling. The package's contribution is a convention that makes integrations reviewable and testable.
  • Weak fit where there is exactly one outbound integration and no roadmap for more. The convention costs more than it saves at n=1.

Migration path

Incremental, single-endpoint first, interface at the seam:

  1. Audit (~30 min, non-negotiable). 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. Pin the version. :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.
  3. Define our own contract first. An interface per API (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.
  4. One read-only endpoint. One class extending the base client, one method, one passing test using Http::fake(). Explicitly not the integration with auth refresh, pagination and webhooks.
  5. Map the slim response to a DTO inside the client. Callers get domain objects; the raw response object never escapes the client boundary.
  6. Promote the pattern. Once step 4 is green, additional integrations are "extend, add methods." At that point the package has earned its place — or can be replaced by our own base class without any call-site changes.

Compatibility

  • A 2021 package will not declare Laravel 10/11 support even if it happens to load. Treat the declared constraints as a lower bound, not a guarantee, and verify by execution.
  • Base-URI joining (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.

Operational Impact

Maintenance

  • Effectively zero upstream maintenance and full internal maintenance. Last release 2021-08-27, 7 stars, 0 dependents: there is no one to escalate to, no security advisory cadence, and no compatibility guarantee for a component that carries outbound credentials and headers.
  • Two defensible postures, and only two: (a) pin 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.
  • Do not build on the plugin API even if it exists. A minor-release, unproven, dormant extension point becomes a permanent internal API surface with no upstream compatibility contract.

Support

  • No upstream support channel, no roadmap, no CVE process. Support is whatever we staff internally. Budget roughly: one engineer-day to audit and stand up the first client, a few hours per additional integration, and a recurring obligation to smoke-test every client on each Laravel upgrade.
  • The reference document — base class plus one worked example — is the actual support artefact. With no community, our own docs are the only ramp-up path and the only thing preventing the next developer from reaching for raw Http::.

Scaling

  • Runtime cost is negligible; this is a very thin wrapper.
  • Cost scales favourably with the number of integrations (each new API is a class, not a project) and unfavourably at upgrade time (a Laravel major touches every client simultaneously). The thinness of the base class is what keeps the blast radius small — but only if the breakage is caught before production, which is the smoke test's job.

Failure modes

  • Deploy-time fatal: "Declaration of ... must be compatible with ..." on class load after a Laravel upgrade.
  • Silent 401: per-request headers overriding the class-level Authorization default.
  • Silent 404: base URI joined without a trailing slash, or doubled slashes, differing between staging and production.
  • Stale configuration: client resolved as a container singleton, then config:cached with an outdated base URI.
  • Transport drift: autodiscovery resolving a different PSR-18 client than config intends.
  • Unhandled errors: 4xx/5xx returned rather than thrown, leaving status checks to every calling method.
  • CI install failure: Composer 2.2+ allow-plugins prompt blocking an opaque install if php-http/discovery is present.

Ramp-up

  • Low for a Laravel developer — half a day with the reference doc and one worked example gets to a working client; the pattern is idiomatic.
  • The audit and the conflicting documentation add a non-recoverable half-day at the front. That cost is fixed and should be scheduled explicitly rather than absorbed, because it is the point at which we learn whether we are adopting a PSR-18 client, a response-header middleware, or neither.
  • Net assessment: worth copying, marginal to depend on. Adopt the pattern; treat the package as a reference implementation to fork or reimplement internally, and make the call-site interface the load-bearing seam so that whichever way the dependency question resolves, no consumer code moves.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console