LaravelPackages.net
Acme Inc.
Toggle sidebar
rockbuzz/lara-client

identifying client applications

9
0
1.0.4
About rockbuzz/lara-client

rockbuzz/lara-client is a Laravel package for identifying client applications. It currently has 0 GitHub stars and 9 downloads on Packagist (latest version 1.0.4). Install it with composer require rockbuzz/lara-client. Discover more Laravel packages by rockbuzz or browse all Laravel packages to compare alternatives.

Last updated

Lara Client

Identifying client applications

Build Status

Requirements

PHP: >=7.1

Install

$ composer require rockbuzz/lara-client

Configuration

$ php artisan vendor:publish --provider="Rockbuzz\LaraClient\ServiceProvider"
$ php artisan migrate

Usage

In App\Http\Kernel.php

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

Add client

$ php artisan client:create clientName

Access Example

$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),
     ]
]);

License

The Lara Client is open-sourced software licensed under the MIT license.

Star History Chart