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

Json Rpc Laravel Package

fguillot/json-rpc

A lightweight PHP implementation of JSON-RPC 2.0 for building clients and servers. It supports method calls, notifications, batch requests, and error handling, with a clean API for exposing PHP classes as remote services. Good for creating APIs or integrating with JSON-RPC services.

View on GitHub
Deep Wiki
Context7

fguillot/json-rpc is a lightweight PHP implementation of the JSON-RPC 2.0 protocol, offering both a client and a server for building and consuming RPC-style APIs. It handles requests, responses, notifications, and structured errors, so you can expose PHP callables as remote methods or call remote services without pulling in a heavy framework.

  • Provides JSON-RPC 2.0 client and server support
  • Maps PHP callables to RPC methods using procedure handlers
  • Accepts positional and named parameters
  • Includes standard request, response, and error classes
  • Framework-agnostic and easy to integrate with HTTP transports
Frequently asked questions about Json Rpc
How do I install fguillot/json-rpc in a Laravel application?
Install it with Composer using composer require fguillot/json-rpc. The package is a plain PHP library with no Laravel service provider, so you need to bind it into the container yourself. A common approach is a small service provider that registers a client adapter behind a JsonRpcClientInterface. Wrap request building and response parsing inside that adapter so controllers and jobs do not depend on the package directly.
Does fguillot/json-rpc support batch requests and notifications?
Yes. The library supports JSON-RPC 2.0 batch requests, notifications, named parameters, and middleware. Notifications are fire-and-forget calls that expect no response, which is useful for command channels and webhook-style flows. Because adoption is low, verify the exact behavior against your target endpoint with contract tests before relying on edge cases.
Is there a Laravel package or service provider for fguillot/json-rpc?
No. fguillot/json-rpc is a framework-agnostic JSON-RPC client and server utility, not a Laravel-native integration. You own the glue code: container bindings, configuration and environment handling, typed request and response wrappers, error mapping, logging, and HTTP transport policy. Keep those concerns in an application-owned adapter rather than scattering package calls through the codebase.
How do I call a remote JSON-RPC endpoint from Laravel using fguillot/json-rpc?
Create a client instance, point it at your endpoint URL, and send method calls through it. In Laravel, externalize the endpoint, timeouts, retry policy, auth headers, TLS settings, and JSON-RPC version via config and environment variables. Keep protocol-specific request construction, batch handling, error codes, and response parsing inside a JsonRpcClientInterface adapter so controllers and jobs stay transport-agnostic. Add logging and failure mapping around that adapter.
Can I expose a Laravel class as a JSON-RPC server with fguillot/json-rpc?
Yes, the library includes a server component that can map JSON-RPC methods to PHP callables or class methods. However, exposing it publicly means you must add authentication, authorization, input validation, rate limiting, replay protection, and error-disclosure controls yourself. The library likely does not solve those concerns on its own. Client mode is generally lower risk than server mode for this reason.
Which PHP and Laravel versions work with fguillot/json-rpc?
The package is a lightweight PHP library with no Laravel-specific version constraint, so check its composer.json and confirm resolution against your existing dependency graph. Run static analysis and integration tests on the oldest and newest PHP and Laravel combinations you support. Do not assume Laravel compatibility just because Composer installs it successfully.
How should I test JSON-RPC integrations in Laravel?
Write contract tests around expected request payloads, batch handling, error codes, and response parsing before wiring the package into domain code. Use a fake or local JSON-RPC server for integration tests so you can assert timeout, retry, and failure-mapping behavior. Keep the tests on the adapter boundary so you can replace the underlying library later without rewriting them.
Is fguillot/json-rpc safe for a public-facing production API?
Be cautious. The library is MIT-licensed, but adoption is very low at roughly 23 stars and zero dependents, which raises the risk of undocumented edge cases and slow security response. It is a poor default for public APIs and fits better as an isolated adapter for internal service-to-service calls, legacy RPC endpoints, or control-plane APIs. Require a proof of concept, contract tests, and an exit path before committing to production.
How do I handle timeouts, retries, and errors with fguillot/json-rpc?
The library handles JSON-RPC protocol concerns, but transport policy such as timeouts, retries, auth headers, and TLS settings must be configured around it. Map JSON-RPC error codes to your application's exception types inside the adapter. Add observability for timeouts and upstream failures, and define an on-call owner for integration issues.
What are alternatives to fguillot/json-rpc, and what if upstream stalls?
A native Laravel HTTP client implementation is a viable fallback for simple JSON-RPC calls, and other JSON-RPC libraries exist if you need broader feature coverage. Because upstream activity and community support are likely limited, budget for dependency pinning, periodic security review, and possibly maintaining a small fork. Keep all package usage behind an adapter so replacement does not touch domain code. Verify release provenance and tag integrity, since the repository link differs from the package name.
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