graze/guzzle-jsonrpc
Abandoned JSON-RPC 2.0 client for Guzzle. Supports Guzzle 6/5/4/3 via branches, with helpers to build notifications, requests, and batch calls. Provides sync and async sending using Guzzle Promises. Consider forking for maintenance.
Pros:
Cons:
HttpClient facade or Http macro support), requiring manual setup.ReactPHP). Migration needed for async workflows.Http client via custom middleware or service container binding.Http::jsonRpc()), forcing manual client instantiation.Http client integration).guzzlehttp/guzzle:^6.5 in composer.json).json_decode strict typing (fixed in v3.2.1 but untested on PHP 8).loop (e.g., Illuminate\Support\Facades\Loop).Http::post()->json() with manual JSON-RPC framing.GuzzleHttp\Middleware).retry helper or Guzzle’s retry middleware.composer require guzzlehttp/guzzle:^7.0).strict_types=1, test json_decode).composer require guzzlehttp/guzzle:^7.0 reactphp/event-loop
$this->app->singleton('jsonrpc.client', function ($app) {
return new \Graze\GuzzleHttp\JsonRpc\Client(
config('services.jsonrpc.url'),
['rpc_error' => true]
);
});
facade('JsonRpc', \App\Facades\JsonRpcClient::class);
Http::fake() or PEST/Mockery.| Component | Laravel 9+ | Guzzle 7.x | PHP 8.x | Async Support |
|---|---|---|---|---|
| Original Package | ❌ | ❌ | ❌ | ⚠️ (Deprecated) |
| Forked Version | ✅ (Manual) | ✅ | ✅ | ✅ (ReactPHP) |
Http client integration, caching).tap or middleware).| Scenario | Impact | Mitigation |
|---|---|---|
| Guzzle 7.x Breaking Changes | RPC calls fail silently. | Feature flags + rollback plan. |
How can I help you explore Laravel packages today?