mohamedmohamedhekal / integrator
This package is abandoned and no longer maintained.
The author suggests using the mohamedhekal/integrator package instead.
Resilient Laravel HTTP client toolkit: retries, rate limits, circuit breakers, and auth strategies
v0.1.0
2026-07-16 14:23 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
- illuminate/cache: ^11.0|^12.0
- illuminate/http: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/phpstan: ^2.0
README
Search terms: laravel, http, api, retry, circuit-breaker, rate-limit, integrations, php, laravel-package, http-client, backoff, third-party-api.
Resilient Laravel HTTP client toolkit for third-party APIs: retries with backoff, Retry-After handling, circuit breakers, and auth strategies.
Problem
Every vendor integration reinvents retries, rate-limit waits, and failure isolation—usually inconsistently and without tests.
Installation
composer require mohamedhekal/integrator php artisan vendor:publish --tag=integrator-config
Quick start
use Hekal\Integrator\Facades\Integrator; $response = Integrator::client('demo')->post('/v1/shipments', [ 'reference' => 'ORD-1', ]); $data = $response->json();
Configure named integrations in config/integrator.php:
'integrations' => [ 'shipping' => [ 'base_url' => env('SHIPPING_API_URL'), 'auth' => [ 'type' => 'api_key', 'api_key' => env('SHIPPING_API_KEY'), 'api_key_header' => 'X-API-Key', ], 'retry' => [ 'enabled' => true, 'max_attempts' => 3, 'base_delay_ms' => 200, 'retry_on' => [429, 500, 502, 503, 504], ], 'circuit_breaker' => [ 'enabled' => true, 'failure_threshold' => 5, 'recovery_seconds' => 60, ], ], ],
Features (v0.1)
- Named clients via
Integrator::client() - Auth:
none,bearer,basic,api_key - Exponential backoff + optional jitter
- Honor
Retry-Afteron 429 (capped) - Cache-backed circuit breaker (closed / open / half-open)
IntegrationExceptionwith status/body/error code- Optional request logging
Testing
composer install
composer test
Architecture
See docs/architecture.md.
License
MIT