This package provides an easy way of connecting to zerorpc from a Laravel application. It uses the PHP zerorpc client.
-
Add facade and providers to
config/app.php
'aliases' => [ ... 'ZeroRPC' => Juwai\LaravelZeroRPC\Facades\ZeroRPC::class, ],
'providers' => [ ... Juwai\LaravelZeroRPC\Providers\ZeroRPCContextProvider::class, Juwai\LaravelZeroRPC\Providers\ZeroRPCClientProvider::class, ],
-
Publish config file:
$ php artisan vendor:publish
-
Add real service configuration to the published config file
config/zerorpc.php
.
$client = ZeroRPC::get('service_one', '1.0');
$response = $client->service_function($param1, $param2);
If you installed Debugbar the RPC connection information shows on Debugbar panels.