thiagof / laravelrpc
JsonRPC Client/Server services for Laravel 5
Installs: 6 102
Dependents: 0
Suggesters: 0
Security: 0
Stars: 33
Watchers: 5
Forks: 12
Open Issues: 1
Requires
- php: >=5.4.0
- fguillot/json-rpc: 1.0.*
- illuminate/support: >=5.0
Requires (Dev)
- laravel/laravel: >=5.0
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-04-13 14:55:52 UTC
README
Installation
# composer
composer require thiagof/laravelrpc
# laravel config
php artisan config:publish thiagof/laravelrpc
# Laravel > 5.1
php artisan vendor:publish --provider="Thiagof\LaravelRPC\RpcServiceProvider"
Configuration
# app/config/app.php
# include the provider
'providers' => array(
[...]
'Thiagof\LaravelRPC\RpcServiceProvider',
);
# 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
use RpcClient;
$result = RpcClient::myServerMethod();
The Server
Route::post('rpc', function() {
$server = app('JsonRpcServer');
$server->attach(new MyRpcMethods);
$server->execute();
});
Further underlying API Reference
Please refer to fguillot/json-rpc