PHP code example of juwai / laravel-http-rpc

1. Go to this page and download the library: Download juwai/laravel-http-rpc library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

juwai / laravel-http-rpc example snippets


    'aliases' => [
        ...
        'HTTPRPC' => Juwai\LaravelHTTPRPC\Facades\HTTPRPC::class,
    ],
    

    'providers' => [
        ...
        Juwai\LaravelHTTPRPC\Providers\HTTPRPCClientProvider::class,
    ],
    

$client = HTTPRPC::get('service_one', '1.0');
$response = $client->service_function($param1, $param2);

$client = HTTPRPC::get('service_one', '1.0', 2000, 'POST');
$response = $client->service_function(['param1' => $param1, 'param2' => $param2]);
bash
    $ php artisan vendor:publish