1. Go to this page and download the library: Download fill84/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/ */
fill84 / laravel-firewall example snippets
'providers' => [
// Other providers...
Fill84\LaravelFirewall\FirewallServiceProvider::class,
];
return [
'suspicious_paths' => [
'wp-admin.php',
'wp-login.php',
'phpinfo.php',
// Add your own patterns...
],
'max_attempts' => 3,
'whitelist_ips' => [
'127.0.0.1',
// Add your trusted IPs...
],
// More configuration options...
];
protected $middleware = [
// Other middleware...
\Fill84\LaravelFirewall\Http\Middleware\Firewall::class,
];
Route::group(['middleware' => 'firewall'], function () {
// Your protected routes...
});
class YourController extends Controller
{
public function __construct()
{
$this->middleware('firewall');
}
}