Looking to hire Laravel developers? Try LaraJobs

laravelrpc maintained by thiagof

Description
JsonRPC Client/Server services for Laravel 5
Last update
2024/09/18 09:53 (dev-master)
License
Links
Downloads
7 540

Comments
comments powered by Disqus

CircleCI

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