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 Laravel Package

tochka-developers/jsonrpc

Laravel package for building JSON-RPC 2.0 APIs, with server and client support, route registration, middleware, validation, and structured error handling. Expose PHP classes as RPC methods and call remote JSON-RPC services.

View on GitHub
Deep Wiki
Context7

tochka-developers/jsonrpc provides a JSON-RPC 2.0 implementation for Laravel, making it easy to expose PHP methods as RPC endpoints and call remote JSON-RPC services through a consistent API.

  • Laravel integration with configuration and service bindings
  • Server and client support for JSON-RPC workflows
  • Structured request handling with method mapping
  • Error and exception handling for reliable responses
  • Extensible design for custom methods and transports
Frequently asked questions about Jsonrpc
What is tochka-developers/jsonrpc used for in Laravel?
It exposes Laravel application logic as JSON-RPC 2.0 endpoints, handling RPC routing, request handling, middleware, error responses, and batched calls. It helps build structured APIs without REST boilerplate. It fits service-layer APIs, especially when using attribute-first definitions and OpenRPC integration.
How do I install tochka-developers/jsonrpc in a Laravel app?
Install it with Composer using composer require tochka-developers/jsonrpc and wire the package into your Laravel application. For v6, your environment must run Laravel 11+ and PHP 8.3+, because Laravel 10 and PHP 8.2 support were dropped. Pin the current stable version in production until you have tested the v6 beta migration path.
Which Laravel and PHP versions does v6 of this JSON-RPC package support?
The v6 major release targets Laravel 11+ and PHP 8.3+. It drops Laravel 10 and PHP 8.2 support, so those platforms must be upgraded first. Older package versions may support earlier Laravel and PHP combinations, but v6 is not a drop-in for legacy runtimes.
How do I define JSON-RPC methods in v6?
v6 uses an attribute-first approach, so every exposed API method must use the #[ApiMethod] attribute. Missing attributes can silently hide methods, so inventory and annotate all RPC controllers and methods during migration. Documentation summary and description metadata move to OpenRPC rather than Laravel package config.
What breaking changes are in v6.0.0-beta.1?
v6 removes config keys such as summary, description, allowParentMethods, and customCasters. It eliminates JsonRpcController trait usage and requires #[ApiMethod] on every exposed method. Custom casters must be replaced with Laravel casts, DTOs, or explicit mapping, and validation and error contracts may change.
Does this package support batched JSON-RPC calls and middleware?
Yes, the package provides batched calls and middleware alongside RPC routing, request handling, and error responses. These features let you build structured JSON-RPC APIs without adding REST boilerplate. Test batch behavior and middleware ordering against your client contracts when upgrading, especially across a major release.
How should I migrate customCasters and JsonRpcController usage?
Replace customCasters with Laravel casts, DTOs, or explicit mapping, then validate serialization and deserialization for parameters and responses. Remove deprecated JsonRpcController trait usage and ensure every exposed method has #[ApiMethod]. Run contract tests for request and response payloads and error formats before production rollout.
What are the risks of adopting the v6 beta in production?
The beta status adds release instability risk, and beta-to-GA behavior may change. Missing ApiMethod attributes can hide methods, removed config keys or traits can cause startup or fatal errors, and customCasters removal can break casting. The validation redesign may also alter client-visible error contracts, so use a migration branch and rollback plan.
How do nested object parameters and ApiValidation work?
v6 adds nested object parameter support and field-level ApiValidation to improve contract expressiveness. This is valuable for DTO-style APIs but increases dependence on correct DTO and serialization behavior. Validate scalar, nested object, and array-of-object parameters, and benchmark deep request graphs on high-traffic RPC endpoints.
What alternatives or maintenance considerations exist for Laravel JSON-RPC?
This package is best suited to Laravel 11+ and PHP 8.3+ services already using JSON-RPC or OpenRPC and willing to adopt attribute-driven definitions. Alternatives depend on whether you need OpenRPC generation, batching, middleware, and Laravel integration, so compare those requirements before switching. Major-version maintenance requires clear ownership of OpenRPC metadata, attribute conventions, and client error contracts.
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.
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
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager