PHPackages                             csun-metalab/laravel-guzzle - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. csun-metalab/laravel-guzzle

ActiveLibrary[HTTP &amp; Networking](/categories/http)

csun-metalab/laravel-guzzle
===========================

Composer package for Laravel 5.0 and above that provides a consistent method of interacting with Guzzle.

1.0.0(8y ago)0717MITPHPPHP &gt;=5.5.9

Since Apr 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/PioneeringTechLab/laravel-guzzle)[ Packagist](https://packagist.org/packages/csun-metalab/laravel-guzzle)[ RSS](/packages/csun-metalab-laravel-guzzle/feed)WikiDiscussions dev Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel Guzzle
==============

[](#laravel-guzzle)

Composer package for Laravel 5.0 and above that provides a consistent method of interacting with Guzzle.

This package is intended to be used to interact with JSON web services but it can also be used with any kind of request endpoint. It provides a basic interface with which to make requests but there is also the option to interact with the underlying Guzzle client instance directly if you need more robust functionality.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
    - [Composer and Service Provider](#composer-and-service-provider)
    - [Middleware Installation](#middleware-installation)
    - [Publish Everything](#publish-everything)
- [Required Environment Variables](#required-environment-variables)
- [Optional Environment Variables](#optional-environment-variables)
    - [Authentication Options](#authentication-options)
    - [Client Options](#client-options)
    - [Other Request Options](#other-request-options)
- [Resources](#resources)

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

[](#installation)

### Composer and Service Provider

[](#composer-and-service-provider)

#### Composer

[](#composer)

**NOTE:** If your Laravel version is above 5.4, Guzzle may not be included by default. Check your `vendor` directory to verify. If you do not have a Guzzle dependency, run this command first:

```
composer require guzzlehttp/guzzle:~6.0

```

To install this package from Composer, use the following command:

```
composer require csun-metalab/laravel-guzzle

```

#### Service Provider

[](#service-provider)

Add the service provider to your `providers` array in `config/app.php` in Laravel as follows:

```
'providers' => [
   //...

   CSUNMetaLab\Guzzle\Providers\GuzzleServiceProvider::class,

   // You can also use this based on Laravel convention:
   // 'CSUNMetaLab\Guzzle\Providers\GuzzleServiceProvider',

   //...
],

```

### Publish Everything

[](#publish-everything)

Finally, run the following Artisan command to publish everything:

```
php artisan vendor:publish

```

The following assets are published:

- Configuration (tagged as `config`) - these go into your `config` directory

Required Environment Variables
------------------------------

[](#required-environment-variables)

There are currently no required environment variables but there are [optional environment variables](#optional-environment-variables).

Optional Environment Variables
------------------------------

[](#optional-environment-variables)

### Authentication Options

[](#authentication-options)

#### GUZZLE\_AUTH\_USERNAME

[](#guzzle_auth_username)

This is the authentication username that will be used for all default Guzzle requests. This value will only be consulted when resolving a `HandlerGuzzle` instance from the `HandlerGuzzleFactory` class.

It will not affect `HandlerGuzzle` objects that have been instantiated directly.

If either the username or password have been provided and are non-empty then the authentication credentials will be set.

Default is `null`.

#### GUZZLE\_AUTH\_PASSWORD

[](#guzzle_auth_password)

This is the authentication password that will be used for all default Guzzle requests. This value will only be consulted when resolving a `HandlerGuzzle` instance from the `HandlerGuzzleFactory` class.

It will not affect `HandlerGuzzle` objects that have been instantiated directly.

If either the username or password have been provided and are non-empty then the authentication credentials will be set.

Default is `null`.

#### GUZZLE\_AUTH\_METHOD

[](#guzzle_auth_method)

This is the authentication method that will be used for all default Guzzle requests. This value will only be consulted when resolving a `HandlerGuzzle` instance from the `HandlerGuzzleFactory` class.

It will not affect `HandlerGuzzle` objects that have been instantiated directly.

Allowed values are `null` (HTTP Basic Authentication), `digest`, and `ntlm`.

Default is `null`.

### Client Options

[](#client-options)

#### GUZZLE\_BASE\_URI

[](#guzzle_base_uri)

This is the base URI that will be used for all default Guzzle requests. This value is only consulted when resolving a `HandlerGuzzle` instance from the `HandlerGuzzleFactory` class.

It will not affect `HandlerGuzzle` objects that have been instantiated directly.

Default is `null`.

### Other Request Options

[](#other-request-options)

#### GUZZLE\_JSON\_ASSOC\_ARRAY

[](#guzzle_json_assoc_array)

Should Guzzle return a JSON response body as an associative array when using the `resolveResponseBody()` method in `HandlerGuzzle`?

The default in Guzzle 5.x was to return a response body as an associative array when using the `json()` response method. Guzzle 6.x does not have a `json()` response method so this can be set to true in order to maintain the original functionality.

Default is `false` (i.e. return the JSON response as a `StdClass` instance).

#### GUZZLE\_VERIFY\_CERT

[](#guzzle_verify_cert)

Should Guzzle verify the server certificate during HTTPS requests? This typically requires the CA cert of the server's chain to be installed on the machine performing the Guzzle request.

During development, this can be set to `false` safely. You may also want to set this to `false` when using WAMP since WAMP tends to have issues with Guzzle when attempting to verify the server certificate.

Default is `true`.

Resources
---------

[](#resources)

### Guzzle

[](#guzzle)

- [Guzzle](http://guzzle.readthedocs.io/en/latest/overview.html)
- [Guzzle Requests](http://guzzle.readthedocs.io/en/latest/quickstart.html#making-a-request)
- [Guzzle Responses](http://guzzle.readthedocs.io/en/latest/quickstart.html#using-responses)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

2990d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef2f088dbe515e7505204053ba4b89fab631db23d7638297853dc697adf7ddc4?d=identicon)[matthewfritz](/maintainers/matthewfritz)

![](https://www.gravatar.com/avatar/5c86fd91fdf698dd5c9ceffd3dce175a6ae3000d00f4c00bf65b2e97f19072a1?d=identicon)[csun-metalab](/maintainers/csun-metalab)

![](https://www.gravatar.com/avatar/eb2e4b7e97c47122102e9eca3a2707f31d812f27d774197f62f27f130d128e49?d=identicon)[luisjg](/maintainers/luisjg)

---

Top Contributors

[![matthewfritz](https://avatars.githubusercontent.com/u/1715181?v=4)](https://github.com/matthewfritz "matthewfritz (20 commits)")

### Embed Badge

![Health badge](/badges/csun-metalab-laravel-guzzle/health.svg)

```
[![Health](https://phpackages.com/badges/csun-metalab-laravel-guzzle/health.svg)](https://phpackages.com/packages/csun-metalab-laravel-guzzle)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.5k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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