Skip to content

macedd/laravelrpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Json-RPC client/server Providers for Laravel 5.x

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages