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

Guzzle Laravel Package

guzzlehttp/guzzle

Guzzle is a PHP HTTP client that makes sending HTTP requests simple and integrating with web services trivial. It supports sync and async requests, PSR-7 and PSR-18 interfaces, streaming uploads and downloads, middleware, and abstracts away the underlying transport.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • PSR-7/PSR-18 Compliance: Unchanged at the contract level in 8.3.0, but the transitive dependency floor moves: guzzlehttp/psr7 is now constrained to ^3.2 and guzzlehttp/promises to ^3.1. Both are major-line positions relative to the PSR-7/PSR-18 v2 generation that Laravel and most of the ecosystem consume. Architectural fit with Laravel's HTTP stack is now gated by transitive constraints, not just the top-level Guzzle constraint.
  • Middleware System: No changes. GuzzleHttp\Middleware::tap(), retry, and logging middleware remain the cross-cutting mechanism. However, the retry middleware's default decision logic keys on exception type, and 8.3.0 changes the classification of two cURL error codes (see Technical Risk) — so the middleware architecture is stable while its inputs shift.
  • Transport Parity (new in 8.3.0): The stream handler has been deliberately aligned with libcurl semantics: chunked bodies decoded incrementally and terminated at the last chunk, truncation and malformed chunking rejected, unsupported transfer codings rejected (matching libcurl 8.14+), bodies ended at declared Content-Length (including 0), early termination raised as an error, gzip/deflate trailing data rejected, and raw deflate accepted. Architecturally this is a consistency win: the stream fallback now produces the same observable behaviour as the cURL transport, which reduces the class of environment-dependent bugs. It also means the stream transport is no longer a lenient escape hatch for malformed upstream responses.
  • PHP 8.6 Forward-Compatibility: Replacement of the deprecated Promise\Is with Promise\State is routine hygiene, but it signals the package is tracking a PHP version not yet in the fleet's baseline. Confirm the internal-only nature of that API surface if any application code touches GuzzleHttp\Promise internals.
  • Transport & Connection Management (carried from 8.2.0): Connection caps (max_host_connections / max_total_connections) combined with persistent transport sharing on libcurl 8.22.0+ remain the primary architectural feature of the 8.x line. Unchanged in 8.3.0.

Integration Feasibility

  • Laravel Framework Constraint — Still the Primary Gate: Laravel 10.x–12.x typically pins guzzlehttp/guzzle: ^7.2 and guzzlehttp/psr7: ^2.x. The 8.3.0 move to psr7 ^3.2 compounds the existing top-level conflict with a second, deeper one: even if the Guzzle constraint is widened by a framework release or an application override, the PSR-7 major line must also be resolvable. Verify both constraints per Laravel minor before any planning.
  • PSR-7 v3 Ripple: Any first-party or vendor package that type-hints Psr\Http\Message\* against the v2 line, or that pins guzzlehttp/psr7 ^2, becomes a resolution blocker. The blast radius of this release is wider than its changelog implies.
  • Promise ^3.1: Verify nothing in the dependency graph pins guzzlehttp/promises ^2. Laravel's queue/pool helpers and any package doing async HTTP are candidates.
  • PHP Floor: Guzzle 8 raises the minimum PHP version (expected 8.1+ from 8.0.0; re-confirm). 8.3.0 additionally targets PHP 8.6 compatibility without requiring it. Runtime image, CI matrix, and static analysis all cascade.
  • Service Container / Bindings: Binding custom GuzzleHttp\Client instances remains unaffected. Config option names should be re-verified against 8.x docs.
  • Queues & Async: Connection caps plus persistent transport sharing remain directly useful for Horizon/queue workers. sendAsync()/getAsync() behaviour is unchanged, though promise internals moved.

Technical Risk

  • Major-Version Blast Radius (unresolved): The 8.0.0 breaking changes remain unreviewed and are still the largest single risk. 8.3.0 adds new constraints on top of an un-audited major. A full UPGRADING.md review and dependency-tree audit is mandatory before any of this is actionable.
  • Laravel Constraint Conflict — Escalated: Now a two-dimensional conflict (guzzle ^7 and psr7 ^2). Likelihood of composer resolution failure is higher than in the prior assessment. Mitigation: check each Laravel minor; do not use --ignore-platform-reqs in production; stay on 7.x until the framework widens support.
  • Exception Reclassification (New): cURL errors 8 and 23 (CURLE_WEIRD_SERVER_REPLY, CURLE_WRITE_ERROR) are now classified as ResponseTransferException with a response attached when a response is available. Any catch block, retry predicate, or Laravel Http::retry() callback that branches on ConnectException / RequestException may silently change behaviour — including retrying things it previously did not, or vice versa. Mitigation: inventory every exception-type check on HTTP calls; confirm ResponseTransferException's position in the hierarchy; add explicit tests.
  • Stream Handler Strictness (New): Truncated, malformed, or unsupported-transfer-coded chunked bodies that previously "worked" now throw. Applications using stream => true — large downloads, proxies, file relays, SSE-ish consumption — may surface exceptions against non-compliant upstreams that were previously tolerated. Mitigation: inventory stream => true usage; test against real upstreams, including any that send sloppy Content-Length or trailing gzip data.
  • Zero-Length Body Semantics (New): Bodies now end at declared Content-Length, including 0. Handlers that assumed a stream would yield more, or that relied on lax termination, need verification.
  • Transitive Constraint Churn (New): The psr7 ^3.2 / promises ^3.1 bumps can force upgrades of unrelated packages, which is a second-order risk not visible in the Guzzle changelog.
  • Runtime-Gated Feature (carried): 8.2.0 pooling silently no-ops on libcurl < 8.22.0. Assert curl_version()['version'] >= 8.22.0 in deployment checks.
  • Connection-Cap Misconfiguration (carried): Over-tight max_total_connections under concurrent queue load causes head-of-line blocking. Load-test before enabling.
  • Carry-over Risks: Proxy/auth validation tightening and stream-handler restrictions from the 7.x line persist; audit raw cURL options.

Key Questions

  1. Framework Constraint (Top-Level): Does the target Laravel version permit guzzlehttp/guzzle: ^8.x, or does it still pin ^7.x?
  2. Framework Constraint (Transitive): Does anything in the dependency graph pin guzzlehttp/psr7 ^2 or guzzlehttp/promises ^2, which 8.3.0 would break?
  3. Exception Mapping: Does any retry policy, middleware, or catch block branch on ConnectException/RequestException in a way that cURL errors 8 and 23 moving to ResponseTransferException would alter?
  4. Stream Usage Inventory: Which code paths use stream => true, and do their upstreams send compliant chunked encoding, accurate Content-Length, and cleanly terminated gzip/deflate?
  5. PHP Baseline: Does the runtime meet Guzzle 8's raised PHP minimum (expected 8.1+)?
  6. libcurl Version: Are production/CI images on libcurl ≥ 8.22.0? If not, 8.2.0's pooling feature is inert and the business case weakens.
  7. 8.0.0 Upgrade Review: Has the 8.0.0 UPGRADING.md been reviewed for breaking changes beyond the 8.2.0/8.3.0 notes?
  8. Concurrency Profile: What are realistic concurrent external-call volumes per worker to size connection caps correctly?
  9. Rollback: Can the app pin back to ^7.14 cleanly if the major upgrade surfaces regressions?

Integration Approach

Stack Fit

  • Laravel HTTP Client: The facade remains the abstraction layer. Where Laravel pins Guzzle 7 / PSR-7 v2, keep using the facade against the bundled client until the framework constraint widens. Re-validate custom macros and Http::withOptions() against 8.x option names.
  • Queues / Horizon / Octane: Best fit for the 8.x line overall — persistent transport sharing with caps suits long-lived workers. Configure caps on the shared client bound in the service container so all jobs inherit the pool.
  • Streaming Consumers: Highest-friction area in 8.3.0. Any download/proxy/relay path using stream => true now gets libcurl-equivalent strictness. Treat these as migration candidates requiring per-upstream validation, not a drop-in change.
  • Third-Party / PSR-18: PSR-18 consumers remain compatible in principle, but the PSR-7 v3 dependency line may exclude interoperating packages. Re-run their suites; verify error/exception shape changes.
  • PHP/libcurl Extensions: Requires cURL (with the 8.22.0+ gate for pooling) or stream fallback for HTTPS. Note the fallback is now stricter.

Migration Path

  1. Constraint Audit (Two Layers): Resolve both the top-level guzzle ^8 question and the transitive psr7 ^3.2 / promises ^3.1 question. If either fails, defer or isolate (e.g., a standalone service) rather than forcing constraints.
  2. Upgrade-Guide Review: Read the 8.0.0 UPGRADING.md end-to-end, then the 8.2.0 and 8.3.0 notes; catalogue breaking changes affecting handlers, options, exceptions, and stream semantics.
  3. Dependency Update:
    composer require guzzlehttp/guzzle:^8.3 --update-with-dependencies
    
  4. Exception Audit: Grep for ConnectException, RequestException, TransferException, and retry predicates; add tests pinning the new cURL-8/23 → ResponseTransferException behaviour.
  5. Stream Audit: Enumerate stream => true call sites; test each against real upstreams for chunked fidelity, Content-Length accuracy (including 0), and gzip/deflate termination.
  6. Capability Check: Verify libcurl version in CI and staging; gate the 8.2.0 pooling feature behind a config flag.
  7. Testing: Unit tests via MockHandler; integration tests for proxy/auth, streaming, and truncated-response handling; load tests with connection caps enabled to validate no head-of-line blocking.
  8. Rollout: Staging behind a feature flag, then canary; keep a documented rollback to ^7.14.

Compatibility

  • Laravel Versions: Verify per-minor composer.json constraints for both guzzlehttp/guzzle and guzzlehttp/psr7. The 7.x/PSR-7-v2 pin is the common blocker. Facade-level compatibility does not imply dependency compatibility.
  • PSR-7 / Promises Ecosystem: psr7 ^3.2 and promises ^3.1 are the widened blast radius of this release; check interoperating packages (nyholm/psr7, symfony/http-client, bridges, SDKs) for compatible or conflicting pins.
  • PHP: Confirm the raised minimum (expected 8.1+); update CI images, static analysis, and platform config. PHP 8.6 support is forward-looking and does not require action yet.
  • libcurl: 8.22.0+ required to realise 8.2.0's pooling; otherwise that feature is effectively a no-op. Stream-parity behaviour in 8.3.0 does not require libcurl 8.22.0 — it applies regardless of transport.

Operational Impact

Maintenance

  • A major version bump plus a transitive major bump (PSR-7 v3) increases surface area for regressions and dependency churn. Budget ongoing effort for re-validating Laravel framework constraint compatibility and re-testing after patch releases within 8.x.
  • 8.3.0's stream-handler changes are behavioural, not cosmetic: pin the exact 8.x patch in composer.lock and treat stream-handler changes as review-worthy in future minor releases, since they ship outside semver's "breaking" label but are observably breaking.

Support

  • Community support exists for Guzzle, but Laravel's official support tracks whatever constraint the framework ships. Overriding to 8.x ahead of framework support means the team owns that divergence and any incident triage, now across two dependency lines.
  • Upstream non-compliance (sloppy chunking, wrong Content-Length) becomes our incident under 8.3.0, where previously it was tolerated. Expect some support load shifting from "silent data corruption" to "new exception" — a net improvement but a visible change.

Scaling

  • Net positive for scale: connection caps + persistent transport sharing on libcurl 8.22.0+ give bounded, reusable pools — better throughput per worker and predictable memory/connection footprint under Horizon/Octane. This remains the primary business justification for the 8.x line.
  • Requires correct cap sizing; over-tight caps throttle concurrency, under-tight caps waste resources.
  • 8.3.0's incremental chunked decoding is a modest memory-behaviour improvement for streamed downloads (bytes are surfaced as they arrive rather than buffered), which favours large-response workloads.

Failure Modes

  • Truncated / malformed upstream responses: Now raise instead of silently yielding a short body. Detect and alert on these explicitly; previously they may have manifested as downstream parse errors far from the cause.
  • Exception-type drift: cURL 8/23 moving to ResponseTransferException can reroute retry logic, altering traffic volume and timeout behaviour under incident conditions.
  • libcurl < 8.22.0: Pooling silently unavailable; teams may believe they are pooling when they are not. Detect at boot and log.
  • Cap exhaustion: Under burst load, capped pools queue requests; monitor wait times and 503/timeout rates.
  • Dependency resolution conflict: Composer failures or forced overrides (Guzzle 8 or PSR-7 v3) that break framework internals or third-party SDKs.
  • Major-version regressions: Unreviewed 8.0.0 changes causing runtime exceptions in handlers/options.

Ramp-up

  • Engineer effort is moderate-to-high and has increased slightly versus the prior assessment: constraint audit now spans two dependency lines, and the 8.3.0 stream/exception changes add a code-inventory pass (exception checks and stream => true sites) that 8.2.0 did not require. The 8.2.0 pooling feature itself remains low-effort once the major upgrade is complete; the cost continues to be dominated by the 7.x → 8.x transition and, newly, by validating PSR-7 v3 coexistence with the Laravel stack.
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.
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
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource