thiagof/laravelrpc
最新稳定版本:0.2.2
Composer 安装命令:
composer require thiagof/laravelrpc
包简介
JsonRPC Client/Server services for Laravel 5
README 文档
README
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
统计信息
- 总下载量: 7.54k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 33
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-26