1. Go to this page and download the library: Download jackmeng/laravel-rpc 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/ */
jackmeng / laravel-rpc example snippets
$this->success([]);
$this->error('');
php artisan rpc_client
(new TestClient())->service('Demo')->list(1);
# Demo.php
class Demo extends \LaravelRcp\Client
{
protected $server = 'test';
public static function list($page=1)
{
return (new self())->method('list',compact('page'));
}
}
#调用
Demo::list()