PHP code example of jundayw / laravel-firewall

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

    

jundayw / laravel-firewall example snippets


'blacklist' => array(
    '127.0.0.1',
    '192.168.17.0/24',
    '127.0.0.1/255.255.255.255',
    '10.0.0.1-10.0.0.255',
    '172.17.*.*',
    'country:br',
    'host:www.baidu.com',
    '/usr/bin/firewall/blacklisted.txt',
),

Route::group(['middleware' => 'firewall.attacks'], function () {
    Route::get('/', 'HomeController@index');
});

php artisan vendor:publish --tag=firewall-config

php artisan vendor:publish --tag=firewall-country