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

Guzzler Laravel Package

blastcloud/guzzler

Guzzler is a lightweight, Laravel-friendly testing helper for Guzzle that lets you fake HTTP requests and assert on what was sent. Define expected requests, return canned responses, and verify methods, URLs, headers, and bodies in your PHP tests without hitting real APIs.

Deep Wiki
Context7

Supercharge your app or SDK with a testing library specifically for Guzzle

Frequently asked questions about Guzzler
How do I install blastcloud/guzzler for Laravel tests?
Install it as a development dependency with Composer, typically using composer require --dev blastcloud/guzzler. Because Guzzler is a test-time helper, it belongs in require-dev rather than your production dependencies. After installation, use its fluent API inside your PHPUnit or Pest tests to fake outgoing Guzzle or Laravel HTTP client requests.
Does Guzzler work with Laravel's HTTP client and raw Guzzle?
Guzzler supports both Laravel's HTTP client and raw Guzzle because it operates at the Guzzle boundary. That means applications that inject GuzzleHttp\ClientInterface or use Laravel's HTTP client can use the same mocking style. If your code only uses Laravel's Http facade, Laravel's built-in fakes may already cover that path.
How do I set up a fluent expectation for an outgoing request in Guzzler?
You declare an expected outgoing request with a fluent builder covering URL, HTTP method, headers, body, and query parameters. Then you attach a canned response that the fake client should return when that expectation matches. Finally, your test exercises the application code and Guzzler records what was sent for later assertions.
Can Guzzler return queued sequential responses for multiple requests?
Yes. Guzzler supports queued sequential responses, so you can define different canned replies for consecutive calls to the same or related endpoints. This is useful for testing retry flows, pagination, or multi-step API interactions. The request history still lets you assert on every call after the test runs.
What request assertions does Guzzler provide after a test runs?
Guzzler records a full request history and provides assertSent and assertNotSent style helpers. You can verify the method, URL, headers, body, and query parameters that your application actually sent. This gives you precise post-act assertions without reaching the network.
Is Guzzler safe to use in production, or is it test-only?
Guzzler is a test-time seam, not a runtime component, so it should be installed as a dev-only dependency. It cannot affect production behavior because it is not loaded in production and mocks HTTP only inside tests. The main production concern is keeping your CI network-isolated and your dev dependencies controlled.
Which Laravel and Guzzle versions does Guzzler support?
The provided overview does not publish an explicit Laravel, Guzzle, or PHPUnit version matrix. You should inspect the package's composer.json for exact constraints before adopting it. The library is built on Laravel's HTTP client and Guzzle, so Guzzle major-version compatibility and PHPUnit major-version alignment are the key things to verify.
How does Guzzler compare to Laravel's Http::fake()?
Laravel's Http::fake() is the built-in option when your application uses the Http facade as its only HTTP path. Guzzler targets Guzzle and Laravel HTTP client requests with a fluent expectation builder and request history for assertSent style checks. Using both in one codebase can create two mocking idioms, so pick the one that matches your actual HTTP seams.
Can I use Guzzler with Pest and PHPUnit, and does it require network access?
Guzzler fits the standard arrange, act, assert model used by PHPUnit and Pest, and it works without touching the network. You define expectations and canned responses, run your application code, then assert on the recorded request history. That makes it suitable for network-isolated CI runs.
Is blastcloud/guzzler actively maintained, and what alternatives exist?
The 2025-07-06 release date is recent, but the small user base, unlisted repository URL, and likely one-or-two-maintainer bus factor are maturity risks to weigh. Alternatives include Laravel's Http::fake() when the Http facade is sufficient, WireMock for external service stubbing, and VCR-style recorded cassettes when contract fidelity matters. Guzzler is a stub library, so it validates what your code sends rather than how the real remote API behaves.
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