thiagof/laravelrpc
Installation
With composer
composer require thiagof/laravelrpc
Laravel configuration
php artisan config:publish thiagof/laravelrpc
# Laravel > 5.1
php artisan vendor:publish --provider="Thiagof\LaravelRPC\RpcServiceProvider"
Configuration
Include the provider in app/config/app.php:
'providers' => array(
[...]
'Thiagof\LaravelRPC\RpcServiceProvider',
);
Also include the alias
'providers' => array(
[...]
'Thiagof\LaravelRPC\RpcClientFacade',
'Thiagof\LaravelRPC\RpcServerFacade',
);
Setup your Client/Server properties in your app config/rpc.php
Usage
The Client
<?php
use RpcClient;
$result = RpcClient::myServerMethod();
The Server
<?php
Route::post('rpc', function() {
$server = app('JsonRpcServer');
$server->attach(new MyRpcMethods);
$server->execute();
});
Further underlying API Reference
Please refer to fguillot/json-rpc
Related Packages
barbushin/laravel-swoole-jsonrpc
JSON-RPC server and client based on swoole, for laravel and lumen framework.
8
1
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 0.2.2 | >=5.4.0 | >=5.0 | MIT | |
| 0.2.1 | >=5.4.0 | >=5.0 | MIT | |
| 0.2.0 | >=5.4.0 | >=5.3 | MIT | |
| 0.1.4 | >=5.4.0 | >=5.0,<5.2 | MIT | |
| 0.1.3 | >=5.4.0 | >=5.0,<5.2 | MIT | |
| 0.1.2 | >=5.4.0 | 5.0.* | MIT |