PHP code example of arubacao / aws-ip-range-middleware

1. Go to this page and download the library: Download arubacao/aws-ip-range-middleware 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/ */

    

arubacao / aws-ip-range-middleware example snippets


// Within App\Http\Kernel Class...

protected $routeMiddleware = [
    'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
    'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
    // .
    // .
    // .
    'aws-ip-range' => \Arubacao\AwsIpRange\AwsIpRangeMiddleware::class,
];

Route::post('api/sns', function () {
    //
})->middleware('aws-ip-range');


// Older Laravel Versions:
Route::post('api/sns', ['middleware' => 'aws-ip-range', function () {
    //
}]);

use Arubacao\AwsIpRange\AwsIpRangeMiddleware;

Route::post('api/sns', function () {
    //
})->middleware(AwsIpRangeMiddleware::class);


// Older Laravel Versions:
Route::post('api/sns', ['middleware' => AwsIpRangeMiddleware::class, function () {
    //
}]);