PHP code example of sajya / client

1. Go to this page and download the library: Download sajya/client 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/ */

    

sajya / client example snippets


$ composer 

use Illuminate\Support\Facades\Http;
use Sajya\Client\Client;

$client = new Client(Http::baseUrl('http://localhost:8000/api/v1/endpoint'));

$response = $client->execute('tennis@ping');

$response->result(); // pong

$response->id();

$response->error();

$response = $client->execute('tennis@ping', [3, 5]);

$response = $client->execute('tennis@ping', ['end' => 10, 'start' => 1]);

$batchData = $client->batch(function (Client $client) {
    $client->execute('tennis@ping');
    $client->execute('tennis@ping');
});

$client->notify('procedure@method');