xigen.io/guzzle-bundle
A PHP bundle that integrates the Guzzle HTTP client, providing a configured service for making HTTP requests in your application. It handles client setup and dependency wiring so you can call APIs and consume web services with less boilerplate.
bundles.php, no auto-discovery. There is no service provider, no facade, no publishable config in the package. Nothing here runs unmodified in a Laravel app.composer.json — read require for guzzlehttp/guzzle and symfony/* ranges plus require.php. If Guzzle is pinned to ^5.0 or ^6.0, Composer will refuse to install alongside Laravel's own guzzlehttp/guzzle: ^7.x dependency. This is usually the end of the exercise.src/DependencyInjection/Configuration.php — this file is the package's real value: a config tree describing named clients, base URIs, timeouts, and handlers/middleware.src/DependencyInjection/*Extension.php — shows how each configured client becomes a service definition.config/guzzle.php array of named clients and a small factory that builds GuzzleHttp\Client instances from it, bound as singletons by name.composer.json.payments, crm, shipping) with base_uri, timeout, headers, retry. Resolve clients by name from the container instead of injecting five distinctly-named clients into constructors.register() — merge config/guzzle.php, bind a GuzzleClientFactory singleton.boot() — nothing. Never resolve clients at boot; that turns HTTP config into a boot-time dependency for every request and every artisan command.singleton closure that builds on first resolution. Keeps handler stacks and middleware out of workers that never make HTTP calls.LoggerInterface-injecting middleware, scoped to a dedicated channel.RetryMiddleware with an explicit decision function — don't hand-roll sleep() loops in services.mapRequest so logs line up across services.HandlerStack per named client so a noisy API can run verbose logging while another stays silent.PaymentGateway taking a ClientInterface lets you swap to Laravel's Http facade later without touching call sites.HandlerStack::create(new MockHandler([...])), or rebind the container entry in setUp(). Assert against the mock's last request.Http::baseUrl(...)->retry(...)->withToken(...) covers it with far less wiring. Reserve a Guzzle registry for streaming, custom handler stacks, non-standard auth, or PSR-18 interop.AppKernel, services.yml, config.yml, or @GuzzleBundle is Symfony-only. Translating YAML service definitions into a Laravel provider is the entire job — for a package with no maintainer.composer why-not xigen.io/guzzle-bundle before debugging anything else. A forced Guzzle downgrade breaks Laravel internals in confusing ways.config: publish, no extra.laravel. You wire every piece by hand; budget accordingly.http_errors semantics. Default true throws RequestException on 4xx/5xx. If downstream code inspects status codes, set http_errors => false per client — and check whether the bundle's config tree exposes that at all. If it doesn't, you're building clients by hand anyway.base_uri trailing slash. https://api.example.com/v1 + /users resolves to https://api.example.com/users — the /v1 silently disappears. End every base_uri with / and be consistent about leading slashes in paths.timeout is 0. A config-driven client that omits it will hang queue workers forever. Set both timeout and connect_timeout on every entry.debug => true dumps bodies — including credentials — to stdout. Use only transiently, never committed, and prefer a scoped logger middleware.ClientInterface gains swappability but loses Guzzle-only options (handler, sink, progress). Decide per call site.HandlerStack override. Those three cover nearly all real customization.config:cache serializes to arrays — keep client definitions array-only (no closures or objects) so the registry still builds after caching.Illuminate\Support\Facades\Http. Reach for raw Guzzle only for streaming, custom stacks, or PSR-18 interop. Reach for this bundle only if it's already in a legacy codebase and you're planning its removal.How can I help you explore Laravel packages today?