PHPackages                             jenky/transmit - 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. jenky/transmit

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

jenky/transmit
==============

Laravel HTTP client manager

1.1.0(4y ago)06MITPHPPHP ^7.2.5|^8.0

Since Jul 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/jenky/transmit)[ Packagist](https://packagist.org/packages/jenky/transmit)[ Docs](https://github.com/jenky/transmit)[ RSS](/packages/jenky-transmit/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (3)Dependencies (7)Versions (5)Used By (0)

Transmit
========

[](#transmit)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b45bfbdfb1126a81c3a99b71dcf1e065d65bc8cb9eed361e16356c35b04d9ae8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a656e6b792f7472616e736d69742e7376673f6c6f676f3d7061636b6167697374267374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/jenky/transmit)[![Test Status](https://camo.githubusercontent.com/11d7aa075c6bf3bdf8ff38c49b75e1f06d6bcefc1ef460c307b200594f891f44/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6a656e6b792f7472616e736d69742f54657374733f6c6162656c3d616374696f6e73266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://github.com/jenky/transmit/actions)[![Codecov](https://camo.githubusercontent.com/8375a1cc190d8520dcd3c5b7026d3cb4a2e54a3ef99c6748868cf1005be16687/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6a656e6b792f7472616e736d69743f6c6f676f3d636f6465636f76267374796c653d666f722d7468652d6261646765)](https://codecov.io/gh/jenky/transmit)[![Total Downloads](https://camo.githubusercontent.com/ef5e3fa4c9572e7afa1883ebe9ffe34d60d457618e1776199436f04c7fd248d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a656e6b792f7472616e736d69742e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/jenky/transmit)[![Software License](https://camo.githubusercontent.com/9897f4467850972a38c7db9a4d38280b8fcdac0ada00e9c8c0a72ecfa8551653/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666f722d7468652d6261646765)](LICENSE.md)

This package allows you to quickly create Http client with pre-defined configurations.

Install
-------

[](#install)

You may use Composer to install Transmit into your Laravel project:

```
$ composer require jenky/transmit
```

After installing Transmit, publish its assets using the `vendor:publish` Artisan command.

```
php artisan vendor:publish
```

or

```
php artisan vendor:publish --provider="Jenky\Transmit\TransmitServiceProvider"
```

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

[](#configuration)

After publishing Transmit's assets, its primary configuration file will be located at `config/transmit.php`. This configuration file allows you to configure your guzzle client options and each configuration option includes a description of its purpose, so be sure to thoroughly explore this file.

### Client configuration

[](#client-configuration)

A client is simply a HTTP client instance with its own configuration. This allows you to create a HTTP client on the fly and reuse anytime, anywhere you want.

### Configure the options

[](#configure-the-options)

Set guzzle request options within the channel. Please visit [Request Options](http://docs.guzzlephp.org/en/stable/request-options.html) for more information.

```
'clients' => [
    'github' => [
        'options' => [
            'base_uri' => 'https://api.github.com/v3/',
            'time_out' => 20,
        ],
    ],
]
```

Then uses it in your code:

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

Http::client('github')->get('....');
```

### Customizing the client Pending Request

[](#customizing-the-client-pending-request)

To get started, define a `tap` array on the channel's configuration. The `tap` array should contain a list of classes that should have an opportunity to customize (or "tap" into) the pending request instance after it is created:

```
'default' => [
    'tap' => [
        App\Http\Client\CustomizeRequest::class,
    ],
],
```

Once you have configured the `tap` option on your client, you're ready to define the class that will customize your client factory instance. This class only needs a single method: `__invoke`, which receives an `Illuminate\Http\Client\PendingRequest` instance.

```
