muhammadhuzaifa / laravel-pulse-guzzle-recorder
Pulse Guzzle Recorder provide a custom recorder for intercepting http requests made via guzzlehttp/guzzle php library and add them into the pulse dashboard if the request is slow. The package uses the guzzle middleware for the data. The recorder intercept and log the request into the Laravel Pulse S
Installs: 7 484
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 2
Forks: 5
Open Issues: 2
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.8
- illuminate/contracts: ^10.0|^11.0
- laravel/pulse: ^1.0@beta|^1.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8|^8.0
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
This package is auto-updated.
Last update: 2024-11-08 01:50:09 UTC
README
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.