Skip to content

Laravel Pulse Guzzle Recorder provide a custom recorder for intercepting http requests made via guzzlehttp/guzzle php library and log them into the Laravel Pulse Slow Outgoing Requests section.

License

Notifications You must be signed in to change notification settings

huzaifaarain/laravel-pulse-guzzle-recorder

Repository files navigation

Laravel Pulse Guzzle Recorder

Laravel Pulse Guzzle

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Laravel Pulse Guzzle Recorder provide a custom recorder for intercepting http requests made via guzzlehttp/guzzle php library and log them into the Laravel Pulse Slow Outgoing Requests section.

LaravelPulseGuzzleRecorder under the hood uses Laravel\Pulse\Recorders\SlowOutgoingRequests::record functionality, so the configuration passed to the said recorder will also affect this recorder.

Installation

You can install the package via composer:

composer require muhammadhuzaifa/laravel-pulse-guzzle-recorder

Add the recorder LaravelPulseGuzzleRecorder in the config/pulse.php file

return [
    'recorders' => [
        // after all of the builtin recorders
        \MuhammadHuzaifa\LaravelPulseGuzzleRecorder\Recorders\LaravelPulseGuzzleRecorder::class => true,
    ]
]

Usage

If you are using Laravel builtin Http facade, then you don't need this package. This package is useful when working with guzzlehttp/guzzle using the Client class. The Client class must be resolved using the service container app.

For example, if you are working with hubspot/api-client and would like to intercept the requests then you can create a custom Client provide it to the HubSpot Factory constructor.

$client = app(\GuzzleHttp\Client::class);
$hubspot = \HubSpot\Factory::createWithAccessToken('access-token', $client);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Laravel Pulse Guzzle Recorder provide a custom recorder for intercepting http requests made via guzzlehttp/guzzle php library and log them into the Laravel Pulse Slow Outgoing Requests section.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages