PHP code example of yish / laravel-accessible-ip

1. Go to this page and download the library: Download yish/laravel-accessible-ip 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/ */

    

yish / laravel-accessible-ip example snippets


'allowed' => [
        '123.11.22.33',
        '123.11.0.0/32'
    ],
 php
    'providers' => [
    ...
    /*
     * Package Service Providers...
     */
    Mombuyish\AccessibleIP\AccessibleIPServiceProvider::class,
    ...
 php
protected $routeMiddleware = [
        'access-ip' => \Mombuyish\AccessibleIP\Middleware\AccessibleIPAddress::class,
    ];
 bash
$ php artisan vendor:publish --provider="Mombuyish\AccessibleIP\AccessibleIPServiceProvider"
 php
'proxies' => [
        env('PROXY_SERVER_IP'),
        '123.11.0.0/32'
    ],
 php
Route::get('/', function () {
    return view('welcome');
})->middleware('access-ip');
 php
Route::group(['middleware' => ['access-ip']], function() {
    Route::get('/', function () {
        return view('welcome');
    });
});