PHPackages                             gehrisandro/laravel-http-psr18 - 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. gehrisandro/laravel-http-psr18

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

gehrisandro/laravel-http-psr18
==============================

A PSR-18 wrapper for Laravel HTTP client

v0.0.1(2y ago)01.2kMITPHPPHP ^8.1.0

Since Jan 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/gehrisandro/laravel-http-psr18)[ Packagist](https://packagist.org/packages/gehrisandro/laravel-http-psr18)[ GitHub Sponsors](https://github.com/gehrisandro)[ RSS](/packages/gehrisandro-laravel-http-psr18/feed)WikiDiscussions main Synced 1mo ago

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

 [![GitHub Workflow Status (main)](https://camo.githubusercontent.com/5b7510d3cd643219db425360d38a18ee5ff4805c867ef168d188c3673fd13103/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676568726973616e64726f2f6c61726176656c2d687474702d70737231382f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d726f756e642d737175617265)](https://github.com/gehrisandro/laravel-http-psr18/actions) [![Total Downloads](https://camo.githubusercontent.com/0aba33bce42f8d707cf00a38c068c41f1b5a09ff3a535a613ff86a5c532b9216/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676568726973616e64726f2f6c61726176656c2d687474702d7073723138)](https://packagist.org/packages/gehrisandro/laravel-http-psr18) [![Latest Version](https://camo.githubusercontent.com/ec40c74fae6a3676676ec73b61cdd310c4c3da42d6822cc68702e4a1aeb28dde/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676568726973616e64726f2f6c61726176656c2d687474702d7073723138)](https://packagist.org/packages/gehrisandro/laravel-http-psr18) [![License](https://camo.githubusercontent.com/501d4517f96b29563d58749f4612af7bc102dfd5c22bc52d0b3976c0256c72cc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f676568726973616e64726f2f6c61726176656c2d687474702d7073723138)](https://packagist.org/packages/gehrisandro/laravel-http-psr18)

---

PSR-18 compatible HTTP Client for Laravel
=========================================

[](#psr-18-compatible-http-client-for-laravel)

This package provides a [PSR-18](https://www.php-fig.org/psr/psr-18/) compatible wrapper for the [Laravel HTTP Client](https://laravel.com/docs/10.x/http-client).

This can be helpful if you want to use the Laravel HTTP Client in a package requiring a PSR-18 compatible HTTP Client.

If you find this package helpful, please consider sponsoring the maintainer:

- Sandro Gehri: **[github.com/sponsors/gehrisandro](https://github.com/sponsors/gehrisandro)**

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

[](#table-of-contents)

- [Get Started](#get-started)
- [Usage](#usage)
- [Contributing](#contributing)

Get Started
-----------

[](#get-started)

> **Requires [Laravel 10](https://github.com/laravel/laravel)** (or at lease the `illuminate/http` package)

First, install the package via the [Composer](https://getcomposer.org/) package manager:

```
composer require gehrisandro/laravel-http-psr18
```

Then, use the `HttpPsr18::make()` method to create a new instance of the PSR-18 compatible HTTP Client.

Usage
-----

[](#usage)

If you call the `make()` method without any arguments, the default Laravel HTTP Client will be used:

```
use HttpPsr18\HttpPsr18;

$client = HttpPsr18::make();

// example usage with OpenAI for Laravel (https://github.com/openai-php/laravel)
$openAI = \OpenAI::factory()
    ->withApiKey('*******')
    ->withHttpClient($client)
    ->make();

$response = $openAI->chat()->create([/* ... */]);
```

You can provide a custom Laravel HTTP Client instance as the first argument:

```
use HttpPsr18\HttpPsr18;
use Illuminate\Support\Facades\Http;

$client = HttpPsr18::make(Http::timeout(300));
```

With this package you get a PSR-18 compatible HTTP Client and you can make use of all the Laravel HTTP Client features. 🥳

```
use GuzzleHttp\Psr7\Request;
use HttpPsr18\HttpPsr18;
use Illuminate\Support\Facades\Http;

Http::fake([
    '*' => Http::response('Hello World'),
]);

$client = HttpPsr18::make();

$response = $client->sendRequest(new Request('GET', 'https://example.com'));

$response->getBody()->getContents(); // Hello World
```

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

[](#contributing)

Thank you for considering contributing to `LaravelHttpPsr18`! The contribution guide can be found in the [CONTRIBUTING.md](CONTRIBUTING.md) file.

---

LaravelHttpPsr18 is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6180f55dc35aac59961f36ce372004c3d00c7447c9e9a4b78e8eff6d8e3b0840?d=identicon)[gehrisandro](/maintainers/gehrisandro)

---

Top Contributors

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

---

Tags

httplaravelhttp clientpsr-18psr18

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gehrisandro-laravel-http-psr18/health.svg)

```
[![Health](https://phpackages.com/badges/gehrisandro-laravel-http-psr18/health.svg)](https://phpackages.com/packages/gehrisandro-laravel-http-psr18)
```

###  Alternatives

[amphp/http-client-psr7

PSR-7 adapter for Amp's HTTP client.

1454.7k4](/packages/amphp-http-client-psr7)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

153.3k](/packages/art4-requests-psr18-adapter)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

1935.1k](/packages/onlime-laravel-http-client-global-logger)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)

PHPackages © 2026

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