PHP code example of rockbuzz / lara-client

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

    

rockbuzz / lara-client example snippets


protected $middlewareGroups = [
    'api' => [
        'throttle:60,1',
        'bindings',
        \Rockbuzz\LaraClient\Identifier::class
    ],
];

$ php artisan client:create clientName

$httpClient = new Guzzle\Http\Client();
$httpClient->request('GET', 'https://endpoint.com/api/resource', [
    'headers' => [
        'X-API-KEY' => $client->publicKey,
        'X-API-TOKEN' => hash_hmac('sha256', $client->publicKey, $client->secretKey),
     ]
]);
bash
$ php artisan vendor:publish --provider="Rockbuzz\LaraClient\ServiceProvider"
bash
$ php artisan migrate