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 Laravel Package

sabre/http

sabre/http wraps PHP's messy superglobals and header()/echo output into clean, mockable Request and Response objects. Instantiate once via Sapi::getRequest(), then pass it around with dependency injection, typehinting on RequestInterface. A lightweight alternative to Symfony HttpFoundation, born fro...

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. sabre/http is a thin, self-contained abstraction over PHP's HTTP superglobals ($_GET, $_POST, $_SERVER, php://input, header()), exposing Request/Response objects plus a SAPI helper and a cURL-backed client. It is not PSR-7, PSR-17, PSR-18, or PSR-15 compliant — it defines its own RequestInterface/ResponseInterface. That makes it a poor fit as the primary HTTP layer in a Laravel application, which already standardizes on Symfony HttpFoundation via Illuminate\Http\Request/Response, and on Guzzle for outbound calls. Introducing sabre/http as a general-purpose abstraction would create a second, parallel HTTP model with no middleware, kernel, or container integration. The defensible fit is narrow and ecosystem-driven: an endpoint that must interoperate with sabre/dav (WebDAV, CalDAV/CardDAV) or a small reverse-proxy/gateway where the library's clone-and-forward ergonomics genuinely reduce code. In those cases sabre/http typically arrives as a transitive dependency and the decision is really "do we accept the sabre stack," not "should we adopt sabre/http."

Integration feasibility. Composer install, BSD-3-Clause, no exotic extensions beyond cURL for the client. Supported PHP baselines (7.4+ on current majors) align with Laravel 8–12, so version resolution is not an obstacle. The documented decorator pattern (RequestDecorator) is a genuinely good integration hook: it lets us attach Laravel-aware behavior — isLoggedIn(), tenant resolution, correlation IDs — without subclassing the core objects or breaking other consumers of the same request instance. Converting between Illuminate\Http\Request and Sabre\HTTP\Request (and back for responses) is roughly 50–100 lines of adapter code and is well understood.

Technical risk. Ranked:

Risk Severity Note
Dual HTTP abstractions High Two request/response models in one codebase invites inconsistent middleware, auth, and logging. Mitigate with a strict boundary adapter and a lint/architecture test.
Superglobal coupling under Octane/Swoole High Sapi::getRequest() reads $_SERVER; long-running workers do not reset superglobals per request the way PHP-FPM does. Must never call SAPI helpers inside a resident worker.
Non-rewindable body streams Medium getBodyAsString() is documented as possibly single-use. A second read silently returns empty. This is a production-grade footgun that will surface as intermittent empty payloads.
Ecosystem isolation Medium No PSR interop means no reuse of PSR-7 middleware, no PSR-18 client swapping, no third-party instrumentation.
Supply chain / bus factor Medium ~190 stars, small maintainer pool, effectively single-vendor stewardship (fruux/sabre-io). Permissive license makes forking viable, but that is a commitment, not a plan.
Metadata quality Low dependents: 0 is inconsistent with a library that is a hard dependency of sabre/dav; the 2026-05-31 release date should also be verified against GitHub tags. Treat registry metrics as unreliable before using them in a build-vs-buy memo.

Key questions. (1) Is sabre/http already in our dependency graph via sabre/dav, and if so which version? (2) Are we running Octane or any resident worker runtime? (3) Do any current or near-term dependencies require PSR-7/PSR-18 interop? (4) What is the actual scope — WebDAV/CalDAV endpoint, reverse proxy, or general HTTP utilities? (5) Who is the named internal owner if upstream maintenance stalls? (6) Does the client's event-based retry model satisfy our resilience requirements, or do we need a first-class retry/backoff/timeout policy?

Integration Approach

Stack fit. Treat sabre/http as an edge adapter library, not a framework layer. Keep Illuminate\Http as the application's request/response contract; keep Guzzle as the default outbound client. Admit sabre/http only inside a bounded module: a DAV endpoint, a proxy controller, or an adapter to a sabre-based subsystem.

Migration path. Do not migrate existing controllers. Introduce one boundary layer — e.g. App\Http\Bridge\SabreBridge — with two methods: toSabre(Illuminate\Http\Request): Sabre\HTTP\Request and toLaravel(Sabre\HTTP\ResponseInterface): Illuminate\Http\Response. Requests enter Laravel middleware as normal, are translated at the module boundary, and responses are translated back so that CORS, cookies, ETag, debug tooling, and exception handling all continue to apply. Bypassing the kernel via Sapi::sendResponse() should be prohibited by review convention; it short-circuits every middleware we rely on.

Compatibility. Since sabre/http is not PSR-7, any PSR-7 requirement must be bridged explicitly (write a translator, or adopt a bridge package) rather than assumed. Pin with a tilde constraint on the current major and add a CI job that runs the Composer audit plus a smoke test on the bridge. If the client is used at all, restrict it to the sabre module and keep Guzzle as the app-wide default so retry/timeout/logging policy lives in one place.

Sequencing.

  1. Inventory — confirm whether sabre/dav is already present and at what version; this often converts the decision from "adopt" to "tolerate and isolate."
  2. Spike (2–3 days) — one endpoint, one adapter, tests covering header case-insensitivity, body re-read behavior, and non-rewindable streams.
  3. Boundary — land the adapter plus an architecture test that fails if Sapi:: or Sabre\HTTP appears outside the module namespace.
  4. Rollout — behind a feature flag, single endpoint, with request/response logging at the bridge.
  5. Review — 30-day checkpoint on error rates, latency, and any body-stream incidents before broadening.

Operational Impact

Maintenance. The library is small, stable, and largely feature-frozen — a maintenance credit, since the API surface a team must track is tiny and the decorator pattern keeps extension local. The offsetting debit is cadence and ownership: a small maintainer group, no published security policy, and a changelog that must be read rather than assumed. Budget roughly 1–2 engineer-days per year for version tracking, plus a documented "fork-and-patch" contingency given the permissive license and modest code size.

Support. Community-only; there is no commercial SLA behind fruux/sabre-io. That is acceptable for a bounded module but unacceptable for anything on the critical path without an internal owner who can read the source. Name that owner before adoption, not after.

Scaling. Inbound scaling is a non-issue: object construction is cheap and the library is stateless, so it scales horizontally exactly like the surrounding Laravel app. Outbound is where the shape matters — the cURL-multi client parallelizes well within a process, but wait() is blocking and per-process, so concurrency is bounded by PHP workers, not by the library. In Octane this needs explicit connection-pool and memory reasoning. The streaming body support is an asset for large payloads, provided nothing calls getBodyAsString() on the hot path.

Failure modes to design against.

  • Silent empty bodies from double-reading a non-rewindable stream — enforce single-read discipline or buffer at the bridge.
  • Superglobal bleed in resident workers — never invoke Sapi::getRequest() under Octane; construct requests explicitly.
  • Header injection — validate names/values before setHeader(); never pass user-controlled strings through unfiltered.
  • Error handling gaps — the client only fires error above 399, so 3xx redirects and connection failures behave differently; retry/timeout policy must be configured on the cURL options and event handlers, not assumed.
  • Proxy misconfiguration — the documented reverse-proxy pattern clones the request and strips Host; get this wrong and you invite host-header and SSRF issues. Restrict target URLs to an allowlist.

Ramp-up. Low for the core API: a mid-level PHP developer is productive with Request/Response and the decorator pattern in under a day, and the async client's event/retry idiom in another. The real ramp is cultural — teaching the team that this is a contained adapter and not a second HTTP framework. Budget half a day of architecture review and one example module to anchor the pattern; without that anchor, the boundary will erode within two sprints.

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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route