PHP code example of royalcms / laravel-jsonrpc-client
1. Go to this page and download the library: Download royalcms/laravel-jsonrpc-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
royalcms / laravel-jsonrpc-client example snippets
use Royalcms\Laravel\JsonRpcClient\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);
$ php artisan vendor:publish
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.