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(9y ago)08.1kMITPHP

Since Jun 16Pushed 9y 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 2w ago

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 62% 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

3301d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5191902?v=4)[Patrick Stephan](/maintainers/pstephan1187)[@pstephan1187](https://github.com/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

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

42010.0k](/packages/venturedrake-laravel-crm)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)

PHPackages © 2026

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