PHPackages                             astrotomic/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. astrotomic/laravel-guzzle

Abandoned → [illuminate/http](/?search=illuminate%2Fhttp)ArchivedLibrary[HTTP &amp; Networking](/categories/http)

astrotomic/laravel-guzzle
=========================

Laravel wrapper for guzzlehttp/guzzle

2.4.0(3y ago)98.5k41MITPHPPHP ^8.0

Since Feb 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Astrotomic/laravel-guzzle)[ Packagist](https://packagist.org/packages/astrotomic/laravel-guzzle)[ Docs](https://astrotomic.info)[ Fund](https://forest.astrotomic.info)[ GitHub Sponsors](https://github.com/Gummibeer)[ RSS](/packages/astrotomic-laravel-guzzle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (9)Used By (1)

Laravel Guzzle HTTP
===================

[](#laravel-guzzle-http)

[![Latest Version](https://camo.githubusercontent.com/9b13eeff67e8f134bd37933bb61da34f8e1a48b13fec3969dcf342e76cec720c/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617374726f746f6d69632f6c61726176656c2d67757a7a6c652e7376673f6c6162656c3d52656c65617365267374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/astrotomic/laravel-guzzle)[![MIT License](https://camo.githubusercontent.com/53f8f7808220edc599e167ae7a10458dc2ee01130830cd68dc38a6a753d2445b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f417374726f746f6d69632f6c61726176656c2d67757a7a6c652e7376673f6c6162656c3d4c6963656e736526636f6c6f723d626c7565267374796c653d666f722d7468652d6261646765)](https://github.com/Astrotomic/laravel-guzzle/blob/master/LICENSE)[![Offset Earth](https://camo.githubusercontent.com/d204555ebe1fb0ae82d10c97b4f4ffc2dfdd2ba1489f98be7f7e8708333a0466/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d677265656e3f7374796c653d666f722d7468652d6261646765)](https://plant.treeware.earth/Astrotomic/laravel-guzzle)[![Larabelles](https://camo.githubusercontent.com/a2c8d5126ddd8c5ddc627176d1d2e0568f8399b50038e71fd7f774c3e24dbe4b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726162656c6c65732d2546302539462541362538342d6c6967687470696e6b3f7374796c653d666f722d7468652d6261646765)](https://www.larabelles.com/)

[![GitHub Workflow Status](https://camo.githubusercontent.com/e15f0c752d8d5adf76a70943909aca52bf9b6df79939f74343d7ff79be649909/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f417374726f746f6d69632f6c61726176656c2d67757a7a6c652f72756e2d74657374733f7374796c653d666c61742d737175617265266c6f676f436f6c6f723d7768697465266c6f676f3d676974687562266c6162656c3d5465737473)](https://github.com/Astrotomic/laravel-guzzle/actions?query=workflow%3Arun-tests)[![StyleCI](https://camo.githubusercontent.com/4d49aca7b0c9e09bd22f06b7ead0594d25dbefbef68f1ff75eaf6f8751e1218b/68747470733a2f2f7374796c6563692e696f2f7265706f732f3234303339343433302f736869656c64)](https://styleci.io/repos/240394430)[![Total Downloads](https://camo.githubusercontent.com/91676b56e984f9002ec3ad1d4b4cc5ac120e2430c95211269ffadba23b461fa7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617374726f746f6d69632f6c61726176656c2d67757a7a6c652e7376673f6c6162656c3d446f776e6c6f616473267374796c653d666c61742d737175617265)](https://packagist.org/packages/astrotomic/laravel-guzzle)

This is a simple wrapper for Laravel around `guzzlehttp/guzzle`. It provides container bindings and a little helper function. The idea was born by reading [Always set a timeout for Guzzle requests inside a queued job](https://divinglaravel.com/always-set-a-timeout-for-guzzle-requests-inside-a-queued-job) by [@themsaid](https://twitter.com/themsaid). Why limit it to the queue? At the end the problem applies to **every** curl request. That's why this package comes with a default config which is applied to every guzzle instance build by this package.

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

[](#installation)

You can install the package via composer:

```
composer require astrotomic/laravel-guzzle
```

After this you should publish the package config and adjust it to your needs.

```
php artisan vendor:publish --provider="Astrotomic\LaravelGuzzle\LaravelGuzzleServiceProvider" --tag=config
```

Usage
-----

[](#usage)

The core of this package is the `\Astrotomic\LaravelGuzzle\Factory` which can handle multiple guzzle clients. There's also a facade that forwards calls to the factory.

```
use Astrotomic\LaravelGuzzle\Facades\Guzzle;
use Psr\Http\Message\ResponseInterface;

/** @var ResponseInterface $response */
$response = Guzzle::client('jsonplaceholder')->get('posts/1');
$response->getStatusCode(); // 200
```

### Default Client

[](#default-client)

By default the `default_client` config refers to a `default` client. The `clients` config key holds all client specific configs. For all possible request options please refer to the [official guzzle docs](http://docs.guzzlephp.org/en/stable/request-options.html).

### new Clients

[](#new-clients)

There are multiple ways to register a new client - the easiest would be to simply add a new config to the `clients` config key. This will also be the most common for users using the package in a Laravel app.

#### Register config

[](#register-config)

If you want to configure your clients from within a service provider you can use the `\Astrotomic\LaravelGuzzle\Factory::register()` method. The registered config will be merged with an optional app config. This will also come in handy for package developers who want to allow the fin al user to customize the guzzle config.

```
use Astrotomic\LaravelGuzzle\Facades\Guzzle;
use Illuminate\Support\ServiceProvider;
use GuzzleHttp\RequestOptions;

class HttpServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        Guzzle::register('jsonplaceholder', [
            'base_uri' => 'https://jsonplaceholder.typicode.com',
            RequestOptions::TIMEOUT => 3,
        ]);
    }
}
```

#### Register Creator

[](#register-creator)

If you have the need to create a real `GuzzleHttp\Client` instance yourself you can do so and assign it to an identifier. This way you can also use a custom client class - the only requirement is that it extends the basic `GuzzleHttp\Client` class.

```
use Astrotomic\LaravelGuzzle\Facades\Guzzle;
use GuzzleHttp\Client;
use Illuminate\Contracts\Container\Container;

Guzzle::extend('astrotomic', static function (Container $app, ?array $config): Client {
    return new Client(array_merge([
        'base_uri' => 'https://astrotomic.info',
    ], $config));
});
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/Astrotomic/.github/blob/master/CONTRIBUTING.md) for details. You could also be interested in [CODE OF CONDUCT](https://github.com/Astrotomic/.github/blob/master/CODE_OF_CONDUCT.md).

### Security

[](#security)

If you discover any security related issues, please check [SECURITY](https://github.com/Astrotomic/.github/blob/master/SECURITY.md) for steps to report it.

Credits
-------

[](#credits)

- [Tom Witkowski](https://github.com/Gummibeer)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Treeware
--------

[](#treeware)

You're free to use this package, but if it makes it to your production environment I would highly appreciate you buying the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to [plant trees](https://www.bbc.co.uk/news/science-environment-48870920). If you contribute to my forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees at [offset.earth/treeware](https://plant.treeware.earth/Astrotomic/laravel-guzzle)

Read more about Treeware at [treeware.earth](https://treeware.earth)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 83.5% 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

Every ~160 days

Recently: every ~238 days

Total

7

Last Release

1313d ago

Major Versions

1.0.1 → 2.0.02020-02-24

PHP version history (3 changes)1.0.0PHP ^7.2

2.3.0PHP ^7.2 || ^8.0

2.4.0PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![Gummibeer](https://avatars.githubusercontent.com/u/6187884?v=4)](https://github.com/Gummibeer "Gummibeer (96 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![mstaack](https://avatars.githubusercontent.com/u/10169509?v=4)](https://github.com/mstaack "mstaack (2 commits)")[![simonbuehler](https://avatars.githubusercontent.com/u/78061?v=4)](https://github.com/simonbuehler "simonbuehler (2 commits)")[![jamesmills](https://avatars.githubusercontent.com/u/557096?v=4)](https://github.com/jamesmills "jamesmills (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![tomhatzer](https://avatars.githubusercontent.com/u/3952168?v=4)](https://github.com/tomhatzer "tomhatzer (1 commits)")

---

Tags

guzzleguzzlehttphacktoberfestlaraveltreewarehttphttp clientGuzzleguzzlehttpastrotomiclaravel-guzzle

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[graze/guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle

981.2M24](/packages/graze-guzzle-jsonrpc)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

11259.2k](/packages/e-moe-guzzle6-bundle)[amphp/http-client-guzzle-adapter

Guzzle adapter for Amp's HTTP client.

1523.6k1](/packages/amphp-http-client-guzzle-adapter)[opgg/riotquest

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

172.6k](/packages/opgg-riotquest)[remic/guzzlecache

Laravel 5 package for caching Guzzle's GET requests.

189.3k](/packages/remic-guzzlecache)

PHPackages © 2026

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