PHPackages                             tangjun/json-rpc-http - 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. tangjun/json-rpc-http

ActiveLibrary[API Development](/categories/api)

tangjun/json-rpc-http
=====================

A laravel package of json-rpc-http-client

1.01(6y ago)015MITPHPPHP &gt;=5.4.0

Since Mar 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/phptj/json-rpc-http)[ Packagist](https://packagist.org/packages/tangjun/json-rpc-http)[ RSS](/packages/tangjun-json-rpc-http/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

json-rpc-http
=============

[](#json-rpc-http)

Laravel 5 json-rpc-http操作

安装
--

[](#安装)

可以通过 [Composer](http://getcomposer.org) 安装 `tangjun/json-rpc-http`， 在`composer.json`require部分引入，然后执行 `composer install`或`composer update`（注意 ：composer update会更新你其他没有固定本部的组件）.

```
{
    "require": {

        "tangjun/json-rpc-http": "~1.01"

    }

}
```

或者

项目根目录执行:

```
composer require tangjun/json-rpc-http

```

使用
--

[](#使用)

要使用sys-audit-log服务提供程序，在引导Laravel应用程序时必须注册该提供程序。有 基本上有两种方法。

Find the `providers` key in `config/app.php` and register the JsonRpcHttpClient Service Provider.

Laravel 5.1+

```
    'providers' => [
        // ...
        TangJun\JsonRpcHttp\JsonRpcHttpServiceProvider::class,
    ]
```

配置
--

[](#配置)

移动配置文件到根目录config下面.

`$ php artisan vendor:publish`

`config/rpc-services.php`

```
$services = [
    [
        'services' => [
            'CalculatorService',
            'ProductService',
        ],
        'nodes' => [
            ['host' => '127.0.0.1', 'port' => 9503],
            ['host' => '127.0.0.1', 'port' => 9503]
        ]
    ]
];

return [
    'services' => $services
];
```

使用
--

[](#使用-1)

```
use TangJun\JsonRpcHttp\JsonRpcHttpClient;

class a extends JsonRpcHttpClient {
    /**
     * The service name of the target service.
     *
     * @var string
     */
    protected $serviceName = 'ProductService';

    /**
     * The protocol of the target service, this protocol name
     *
     * @var string
     */
    protected $protocol = 'jsonrpc-http';

    // 实现一个加法方法，这里简单的认为参数都是 int 类型
    public function list($where,$select,$page,$perPage)
    {
        return $this->__request(__FUNCTION__,compact('where','select','page','perPage'));
    }

}

$a = new a();

$resp = $a->list(" id > 10001 and status > 0 ",['id'],1,10);

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

2251d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59a09c7331c2b697c80927d03268d2cd68059ddf71a39061e8780f0cfd83eed1?d=identicon)[phptj](/maintainers/phptj)

---

Top Contributors

[![phptj](https://avatars.githubusercontent.com/u/18510201?v=4)](https://github.com/phptj "phptj (7 commits)")

---

Tags

laraveljson-rpc-http

### Embed Badge

![Health badge](/badges/tangjun-json-rpc-http/health.svg)

```
[![Health](https://phpackages.com/badges/tangjun-json-rpc-http/health.svg)](https://phpackages.com/packages/tangjun-json-rpc-http)
```

###  Alternatives

[rakibdevs/openweather-laravel-api

Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately

7648.2k](/packages/rakibdevs-openweather-laravel-api)

PHPackages © 2026

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