PHPackages                             hiddeco/laravel-http-adapter - 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. [Framework](/categories/framework)
4. /
5. hiddeco/laravel-http-adapter

ActiveLibrary[Framework](/categories/framework)

hiddeco/laravel-http-adapter
============================

Issue HTTP requests through the most popular HTTP clients with Laravel. Build upon the Ivory HTTP Adapter.

v0.1(10y ago)222MITPHPPHP &gt;=5.5.9

Since Jul 31Pushed 10y agoCompare

[ Source](https://github.com/hiddeco/laravel-http-adapter)[ Packagist](https://packagist.org/packages/hiddeco/laravel-http-adapter)[ RSS](/packages/hiddeco-laravel-http-adapter/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Laravel HTTP Adapter (DEPRECATED)
=================================

[](#laravel-http-adapter-deprecated)

[![Build Status](https://camo.githubusercontent.com/8eebce9d0344d1fc6c0a13ad30f2b0d879da260aef972b40c166c0a6cc9cc707/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6869646465636f2f6c61726176656c2d687474702d616461707465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/hiddeco/laravel-http-adapter/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e6c822cd4c60a80960a944f9513d500b7c24e14222fb154b21bace5c9e0f56ec/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6869646465636f2f6c61726176656c2d687474702d616461707465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/hiddeco/laravel-http-adapter/?branch=master)[![MIT license](https://camo.githubusercontent.com/4661abfe916186acde514558e7f040833cb63ba7098401a51ce339cbb2b4cf9e/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](http://opensource.org/licenses/MIT)[![StyleCI](https://camo.githubusercontent.com/d5a5f285c8ceedd4d5abc75b5f8a13e38bad12243e7de4e02fe7173587c82bea/68747470733a2f2f7374796c6563692e696f2f7265706f732f34303032303739302f736869656c64)](https://styleci.io/repos/40020790)[![SensioLabsInsight](https://camo.githubusercontent.com/87323dd433eb3739cf36c4f0efeb3416b53f0325b3fd41717ae749cd9bbba863/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f36363264656665642d636537632d343034632d393837372d6537306237623632343334372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/662defed-ce7c-404c-9877-e70b7b624347)

**Laravel HTTP Adapter is officialy deprecated. Use [phphttp/laravel](https://github.com/php-http/laravel-httplug) based upon [httplug](http://httplug.io) instead.**

Laravel HTTP Adapter is an [Ivory HTTP Adapter](https://github.com/egeloen/ivory-http-adapter) bridge, which integrates the ability of using multiple adapters with their own configuration through one API.

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

[](#installation)

To use this package without running into trouble you will need PHP 5.5+ or HHVM 3.6+, and Composer.

1. Get the latest version of Laravel HTTP Adapter, add the following line to your composer.json file `"hiddeco/laravel-http-adapter": "0.1"`

    The package supports the following adapters, you will need to install the ones you want to use.

    - `"ext-curl": "*"`
    - `"ext-http": "*"`
    - `"guzzle/guzzle": "^3.9.4@dev"`
    - `"guzzlehttp/guzzle": "^4.1.4|^5.0"`
    - `"kriswallsmith/buzz": "^0.13"`
    - `"nategood/httpful": "^0.2.17"`
    - `"zendframework/zendframework1": "^1.12.9"`
    - `"zendframework/zend-http": "^2.3.4"`
2. Run `composer update` or `composer install`
3. Register the Laravel HTTP Adapter service provider in `config/app.php` by adding `'HiddeCo\HttpAdapter\HttpAdapterServiceProvider'` to the providers key
4. Add the `HttpAdapter` facade to the aliases key: `'HttpAdapter' => 'HiddeCo\HttpAdapter\Facades\HttpAdapter'`

Configuration
-------------

[](#configuration)

To manage your HTTP adapters run the `php artisan vendor:publish` command, this will create the `config/httpadapter.php`file where you can modify and manage your adapter connections.

The following configuration options are available:

**Global Configuration**

The Global Configuration (`global`) overrules all the other configurations set for your HTTP adapters. It accepts the same parameters as an HTTP adapter connection does.

**Default Connection Name**

The adapter connection name set here (`default`) is the default connection used for all requests. However, you may use as many connections as you need using the manager class. The default setting is `'main'`.

**HTTP Adapter Connections**

This is the place to configure your HTTP adapter connections (`connections`). A default configuration with possible options is already present and there is no limit to the amount of connections.

The following adapters are available: `buzz`, `cake`, `curl`, `file_get_contents`, `fopen`, `guzzle`, `guzzle_http`, `httpful`, `react`, `socket`, `zend1` and `zend2`.

Usage
-----

[](#usage)

### HTTP Adapter Manager

[](#http-adapter-manager)

The `HttpAdapterManager` is where the magic happens. Bounded to the ioc container as `httpadapter` and accessible by using the `Facade\HttpAdapter` facade. It uses parts of the [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager)package to manage the HTTP adapter connections. For more information about the Manager you should check out the respective [docs](https://github.com/GrahamCampbell/Laravel-Manager#usage).

It is worth noting the connection returned will always be an instance of `\Ivory\HttpAdapter\HttpAdapterInterface`. You can find more information about this instance and its methods in the [Ivory HTTP Adapter docs](https://github.com/egeloen/ivory-http-adapter/blob/master/doc/usage.md).

### HTTP Adapter Facade

[](#http-adapter-facade)

The HTTP Adapter facade will pass static method calls to the `httpadapter` object in the ioc container, which as stated before is the `HttpAdapterManager` class.

### Examples

[](#examples)

The usage of this package is fairly simple. The `main` connection is preconfigured and uses the `file_get_contents` HTTP adapter, no other configuration options are set for this connection by default.

**Using the Facade**

```
use HiddeCo\HttpAdapter\Facades\HttpAdapter;

$request = HttpAdapter::get('http://awesome.com');
$body = $request->getBody();
// and you're done
```

**Using the HTTP Adapter Manager**

The `HTTPAdapterManager` returns an instance of `\Ivory\HttpAdapter\HttpAdapterInterface` and will behave like it. If you want to call a specific connection, you can use the `connection` method:

```
use HiddeCo\HttpAdapter\Facades\HttpAdapter;

$request = HttpAdapter::connection('alternative')->get('http://awesome.com');
```

Changing the default connection and further explanations:

```
use HiddeCo\HttpAdapter\Facades\HttpAdapter;

HttpAdapter::connection('main')->get('http://awesome.com');
HttpAdapter::get('http://awesome.com');
HttpAdapter::connection()->get('http://awesome.com');
// are all the same because

HttpAdapter::getDefaultConnection();
// returns 'main' as set in the configuration file

HttpAdapter::setDefaultConnection('alternative');
// the 'alternative' connection is now the default connection
```

**Dependency Injection**

Prefer the use of a dependency injection over facades? You can easily inject the manager:

```
use HiddeCo\HttpAdapter\HttpAdapterManager;

class Foo
{
	protected $httpadapter;

	public function __construct(HttpAdapterManager $httpadapter)
	{
		$this->httpadapter;
	}

	public function bar()
	{
		$this->httpadapter->get('http://awesome.com');
	}
}
```

### Events

[](#events)

If you set the `eventable` key in the general or local HTTP adapter configuration to `true` the `\Ivory\HttpAdapter\EventDispatcherHttpAdapter`will be used to make your HTTP adapter connection. This way it's possible to listen to events that are dispatched using the Laravel dispatcher. All available events can be found in the [Ivory HTTP docs](https://github.com/egeloen/ivory-http-adapter/blob/0.7.1/doc/events.md#events).

```
use Ivory\HttpAdapter\Event\Events;
use Ivory\HttpAdapter\Event\PostSendEvent;

Event::listen(Events::POST_SEND, function (PostSendEvent $event) {
	Log::info("A request was made");
});
```

It is also possible to register the event listener using the `EventServiceProvider`.

License
-------

[](#license)

Laravel HTTP Adapter is licensed under the MIT License (MIT).

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

3990d ago

### Community

Maintainers

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

---

Top Contributors

[![hiddeco](https://avatars.githubusercontent.com/u/10063039?v=4)](https://github.com/hiddeco "hiddeco (8 commits)")

---

Tags

httpframeworklaraveladapterivory

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hiddeco-laravel-http-adapter/health.svg)

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M305](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M885](/packages/laravel-socialite)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k21.5M588](/packages/laravel-boost)

PHPackages © 2026

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