PHP code example of lelectrolux / hmac-utils

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

    

lelectrolux / hmac-utils example snippets


use Lelectrolux\Hmac\Laravel\Middleware;

// Any key => secret pair allowed
Route::get('/some/uri')->middleware(Middleware::class)

// Ony those keyed by foo or bar
Route::get('/some/uri')->middleware(Middleware::class.':foo,bar')

use Illuminate\Support\Facades\Http;
use Lelectrolux\Hmac\Guzzle\MiddlewareFactory;

Http::createPendingRequest()->withMiddleware($middlewareFactory->make('foo'))->...
shell
php artisan vendor:publish --provider=Lelectrolux\Hmac\Laravel\ServiceProvider