PHPackages                             pstephan1187/laravel-guzzler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. pstephan1187/laravel-guzzler

AbandonedLibrary[Testing &amp; Quality](/categories/testing)

pstephan1187/laravel-guzzler
============================

A package that wraps guzzle to enable easy testing of HTTP responses

v1.0.0(8y ago)08.1kMITPHP

Since Jun 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/pstephan1187/laravel-guzzler)[ Packagist](https://packagist.org/packages/pstephan1187/laravel-guzzler)[ RSS](/packages/pstephan1187-laravel-guzzler/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel Guzzler
===============

[](#laravel-guzzler)

Laravel Guzzler is a package that makes it easy to test application logic that makes HTTP requests. Guzzle includes functionality to test requests, but you would need to be able to pass configuration parameters to the Guzzle object from within your tests and that is usually impractical. This package makes it a cinch:

```
test_my_function_returns_client_id()
{
    Guzzler::respondWith(json_encode(['client_id' => 123]))->hijack();

    $client_id = myFunctionThatReturnsAClientIdFromAnApiRequest();

    $this->assertEquals(123, $client_id);
}

```

Installation
------------

[](#installation)

```
composer require pstephan1187/laravel-guzzler

```

Add the service provider to your app config file:

```
Guzzler\GuzzlerServiceProvider::class,

```

Optionally, add the facade (The documentation assumes you do this):

```
'Guzzler' => Guzzler\Facades\Guzzler::class,

```

Usage
-----

[](#usage)

Anywhere you would normally `new GuzzleHttp\Client($params)`, you would replace that with `guzzle($params)`;

```
$client = guzzle(['base_uri' => 'https://www.mysite.com']);

```

When it comes time to test your method, you will hijack the HTTP request and return a custom response:

```
Guzzler::respondWith($body, $status_code, $headers)->hijack();

```

You can chain multiple responses as well:

```
Guzzler::respondWith($body, $status_code, $headers)// gets returned the first time guzzle makes an HTTP request
    ->respondWith($second_body, $second_status_code, $second_headers)// gets returned the second time guzzle makes an HTTP request
    ->respondWith($third_body, $third_status_code, $third_headers)// gets returned the third time guzzle makes an HTTP request
    ->hijack();

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3252d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7704d5cef6628cbf7c8d3273346af2b98cb92064d9d0b3ca3cc1658cb6c2c544?d=identicon)[pstephan1187](/maintainers/pstephan1187)

---

Top Contributors

[![pstephan1187](https://avatars.githubusercontent.com/u/5191902?v=4)](https://github.com/pstephan1187 "pstephan1187 (2 commits)")

---

Tags

guzzlehttp-requestslaravellaravel-5testing

### Embed Badge

![Health badge](/badges/pstephan1187-laravel-guzzler/health.svg)

```
[![Health](https://phpackages.com/badges/pstephan1187-laravel-guzzler/health.svg)](https://phpackages.com/packages/pstephan1187-laravel-guzzler)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[christophrumpel/missing-livewire-assertions

This package adds missing livewire test assertions.

149336.0k9](/packages/christophrumpel-missing-livewire-assertions)[calebdw/larastan-livewire

A Larastan / PHPStan extension for Livewire.

43482.4k3](/packages/calebdw-larastan-livewire)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
