PHP code example of mattitjaab / bad-ip-blocker
1. Go to this page and download the library: Download mattitjaab/bad-ip-blocker 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/ */
mattitjaab / bad-ip-blocker example snippets
use Mattitja\BadIpBlocker\Middleware\CheckBadIps;
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
...
)
->withMiddleware(function (Middleware $middleware) {
$middleware->append(CheckBadIps::class);
})
->create();
bash
php artisan cache:forget bad-ip-blocker
bash
php artisan cache:clear