Identifying client applications
PHP: >=7.1
$ composer require rockbuzz/lara-client
$ php artisan vendor:publish --provider="Rockbuzz\LaraClient\ServiceProvider"
$ php artisan migrate
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),
]
]);
The Lara Client is open-sourced software licensed under the MIT license.