PHPackages                             sajya/client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sajya/client

ActiveLibrary[API Development](/categories/api)

sajya/client
============

HTTP client and server for JSON-RPC 2.0

1.4.1(4mo ago)21996.6k↓45.5%5MITPHPCI failing

Since Oct 18Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/sajya/client)[ Packagist](https://packagist.org/packages/sajya/client)[ Docs](https://sajya.github.io)[ RSS](/packages/sajya-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (5)Versions (12)Used By (0)

Introduction
------------

[](#introduction)

[![run-tests](https://github.com/sajya/client/actions/workflows/run-tests.yml/badge.svg)](https://github.com/sajya/client/actions/workflows/run-tests.yml)

This package lets you set up a JSON-RPC client over HTTP(S), using your PHP code to make the requests. Built around [Laravel](https://laravel.com/docs/8.x/http-client#introduction) (Doesn't require the entire framework, just its component) expressive HTTP wrapper, it allows you to customize things like authorization, retries, and more.

Install
-------

[](#install)

Go to the project directory and run the command:

```
$ composer require sajya/client
```

Usage
-----

[](#usage)

```
use Illuminate\Support\Facades\Http;
use Sajya\Client\Client;

$client = new Client(Http::baseUrl('http://localhost:8000/api/v1/endpoint'));

$response = $client->execute('tennis@ping');

$response->result(); // pong
```

By default, the request identifier will be generated using the [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier), you can get it by calling the `id()` method

```
$response->id();
```

To get the result of an error, you need to call the `error()` method

```
$response->error();
```

### Parameters

[](#parameters)

Example with positional parameters:

```
$response = $client->execute('tennis@ping', [3, 5]);
```

Example with named arguments:

```
$response = $client->execute('tennis@ping', ['end' => 10, 'start' => 1]);
```

### Batch requests

[](#batch-requests)

Call several procedures in a single HTTP request:

```
$batchData = $client->batch(function (Client $client) {
    $client->execute('tennis@ping');
    $client->execute('tennis@ping');
});
```

### Notify requests

[](#notify-requests)

```
$client->notify('procedure@method');
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance82

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~166 days

Recently: every ~218 days

Total

8

Last Release

146d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c47797b11041f37c2eec74b09bc6619c8997467d690797ebad0e6ab7cb232b7?d=identicon)[tabuna](/maintainers/tabuna)

---

Top Contributors

[![tabuna](https://avatars.githubusercontent.com/u/5102591?v=4)](https://github.com/tabuna "tabuna (71 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (32 commits)")[![AlexLeshchenko91](https://avatars.githubusercontent.com/u/37211916?v=4)](https://github.com/AlexLeshchenko91 "AlexLeshchenko91 (1 commits)")[![kimkit](https://avatars.githubusercontent.com/u/1448791?v=4)](https://github.com/kimkit "kimkit (1 commits)")

---

Tags

apirpcjson-prc

### Embed Badge

![Health badge](/badges/sajya-client/health.svg)

```
[![Health](https://phpackages.com/badges/sajya-client/health.svg)](https://phpackages.com/packages/sajya-client)
```

###  Alternatives

[sajya/server

Easy implementation of the JSON-RPC 2.0 server for the Laravel framework.

2391.9M4](/packages/sajya-server)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
