Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Jsonrpc Client

Jsonrpc Client Laravel Package

tochka-developers/jsonrpc-client

A PHP/Laravel JSON-RPC client for connecting to remote JSON-RPC services with a clean, expressive API. It simplifies request building, endpoint configuration, and error handling, making it easy to integrate JSON-RPC APIs into Laravel applications.

View on GitHub
Deep Wiki
Context7

tochka-developers/jsonrpc-client is a lightweight JSON-RPC client for PHP and Laravel applications. It offers a clean, fluent API for calling remote JSON-RPC services, serializing requests, parsing responses, and surfacing transport or RPC failures as exceptions.

  • Supports JSON-RPC 2.0 requests and notifications
  • Simple, fluent method-call interface
  • Configurable HTTP transport and request options
  • Clear exceptions for transport and RPC errors
  • Laravel service provider and facade integration
Frequently asked questions about Jsonrpc Client
How do I install the JSON-RPC client package for Laravel?
Install the package with Composer using composer require tochka-developers/jsonrpc-client. Laravel package auto-discovery should register the service provider where the package supports it; if auto-discovery is disabled, register the provider manually. Check the package README for any publishable configuration or environment variables before making your first request.
Which Laravel versions does tochka-developers/jsonrpc-client support?
Laravel version support is defined by the package's Composer constraints, so check the require section in its composer.json or the Packagist release notes. Confirm that your Laravel and PHP versions match those constraints before installing in a production application. If you are upgrading Laravel, test the client integration in a staging environment first.
How do I make a JSON-RPC request with the fluent request builder?
The package provides a fluent builder for defining the JSON-RPC method, parameters, and request metadata before sending it to the remote endpoint. You typically resolve or inject the client, build the request, and then send it through the configured transport. Use the package documentation for the exact method names and response handling in your installed version.
Does this JSON-RPC client support batch requests?
Yes, the package includes batch request support, allowing multiple JSON-RPC calls to be sent in a single transport request. This is useful when you need to reduce network overhead or group related remote operations. Check the README for how batch responses are returned and how individual errors are represented.
How do JSON-RPC notifications work in this Laravel client?
JSON-RPC notifications are requests sent without an id, meaning the server should not return a response. The package supports notification-style calls for fire-and-forget operations such as logging, events, or background updates. Use notifications when you do not need to inspect the result or handle a per-call response.
What are typed responses and how do I use them?
Typed responses let you map a JSON-RPC result into a defined PHP type instead of working with untyped arrays. This improves readability, static analysis, and testability when integrating with remote services. Refer to the package documentation for the supported mapping approach and how to define your response classes.
Can I use this JSON-RPC client outside of Laravel in plain PHP?
Yes, the package is described as a JSON-RPC client for PHP and Laravel, so the Laravel integration is an optional convenience rather than a hard requirement. In plain PHP you can instantiate and configure the client directly. The Laravel service provider and container bindings simply make configuration and injection cleaner in a Laravel application.
How do I test JSON-RPC calls in Laravel without hitting a real remote API?
Because the package is designed for clean, testable service-to-service communication, you should inject the client or a wrapper around it and replace it with a mock or fake in your tests. Assert that your application builds the expected JSON-RPC method and parameters, and return canned responses for success and error cases. This keeps tests fast and avoids depending on external services.
How should I handle JSON-RPC errors and exceptions?
JSON-RPC servers return structured error objects with a code, message, and optional data field. The client should surface these as exceptions or typed error results depending on the package API, so catch them at the boundary of your service call and translate them into application-specific errors or retries. Always log the JSON-RPC error code and message for debugging remote integration failures.
Is this package actively maintained, and what alternatives exist?
Check the GitHub repository and Packagist release history for recent commits, open issues, and compatible Laravel version constraints before adopting it. If maintenance activity is a concern, compare it with other JSON-RPC client packages or a lightweight Guzzle-based implementation. The right choice depends on whether you need Laravel integration, batch support, typed responses, and a fluent request builder.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource