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

Buzz Laravel Package

kriswallsmith/buzz

Buzz is a lightweight PHP library for issuing HTTP requests, with FileGetContents, Curl, and MultiCurl clients supporting batch requests and HTTP2 server push. It works with PSR-7 messages and any PSR-17 factory.

View on GitHub
Deep Wiki
Context7

PHP's lightweight HTTP client

Frequently asked questions about Buzz
How do I install kriswallsmith/buzz in a Laravel application?
Run composer require kriswallsmith/buzz, then install a PSR-17 factory such as nyholm/psr7 because Buzz delegates PSR-7 message creation to that factory. Installation is framework-agnostic: there is no Laravel service provider shipped with the package, so you register your own binding in a provider if you want container injection. After that you can construct Buzz\Browser directly or resolve Psr\Http\Client\ClientInterface from the container.
Which Laravel and PHP versions does Buzz support?
Buzz is a framework-independent library targeting PHP 7.1 and above, so it runs on any Laravel release whose PHP constraint you already satisfy. It has no Laravel-specific dependency and does not tie you to a particular Laravel major version. Check the package's composer.json constraints against your runtime before upgrading PHP, since the project is frozen and will not add new platform support on request.
How do I bind Buzz to Laravel's service container?
Register a singleton in a service provider that returns a Buzz\Client\Curl instance wrapped with your PSR-17 factory, and bind it to Psr\Http\Client\ClientInterface. Type-hint that interface in your gateway or service classes so the concrete client stays swappable with Guzzle or Symfony HttpClient later. If you want the ergonomic get()/post()/getLastRequest() helpers, also bind or resolve Buzz\Browser with the client plus a PSR-17 request factory.
Can Buzz replace Guzzle and Laravel's Http facade?
Not directly. Laravel's Http facade is Guzzle-backed, so existing Http:: calls will not route through Buzz without an adapter you write yourself. The defensible pattern is to standardise outbound HTTP behind PSR-18, inject Psr\Http\Client\ClientInterface, and treat Buzz, Guzzle, and Symfony HttpClient as interchangeable implementations. Buzz\Browser gives you similar get()/post() ergonomics plus getLastRequest() for debugging, but it is not a drop-in facade replacement.
Why do my Buzz requests hang, and how do I set a timeout?
Since version 1.0.0 the default timeout changed from 30 seconds to 0, meaning no limit at all. Every call site must pass an explicit timeout, for example $client->sendRequest($request, ['timeout' => 4]) or via Browser options. Treat this as a policy item: enforce timeouts in code review or wrap Buzz in your own client decorator that injects sane defaults.
How do I add authentication headers or logging to Buzz requests?
Buzz ships middleware for the common cross-cutting concerns: BearerAuthMiddleware, BasicAuthMiddleware, LoggerMiddleware, and ContentTypeMiddleware, plus cookie handling. You stack them on Buzz\Browser, which keeps auth and logging out of your gateway code. Note that there are no native Laravel events or Laravel logger integrations, so wire any PSR-3 logger you already use.
How do I send concurrent or batch HTTP requests with Buzz?
Use Buzz\Client\MultiCurl, which handles batch requests and HTTP/2 server push. Unlike the synchronous Curl and FileGetContents clients, MultiCurl defers exceptions into callbacks, so error handling semantics differ and must be documented for the team. This makes it a good fit for scheduled fan-out jobs, not for request-per-user synchronous paths.
Does Buzz support retries, backoff, or connection pooling?
No. Buzz has no built-in retry or backoff logic, no connection-pool configuration, and no native Laravel integration, so those behaviours are yours to implement. A common approach is a small decorator around Psr\Http\Client\ClientInterface that adds retry, jitter, and TLS-verification defaults, keeping the underlying client replaceable. If retry middleware is a hard requirement out of the box, Guzzle is the better starting point.
Is kriswallsmith/buzz still actively maintained?
The README states the project has reached its goal, with no plans to actively develop new features or change the existing API, and it will probably not accept new configuration options. In practice this is a stable but frozen dependency: strong backwards compatibility with BC-check CI, but no upstream roadmap leverage. It is MIT licensed, widely downloaded, and safe to adopt if your governance policy accepts minimally-maintained packages.
How do I test Laravel code that uses Buzz?
Because Buzz implements PSR-18, the cleanest approach is to fake Psr\Http\Client\ClientInterface with a test double that returns PSR-7 responses built from your PSR-17 factory, then bind it in the container. That keeps tests framework-agnostic and lets you assert the exact requests your gateway builds. Laravel's Http::fake() does not intercept Buzz, so any existing facade-based assertions will not cover these call sites.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo