pratik-dabhi/laravel-firewall
Laravel firewall middleware for blocking abusive traffic by IP rules such as allow/deny lists and access restrictions. Helps protect routes and applications from unwanted requests with simple configuration and integration into a Laravel app.
A powerful, extensible, and developer-friendly application-level firewall for Laravel 10+.
This package gives your Laravel app real-time protection through:
It brings enterprise-level request filtering & monitoring into your Laravel application with minimal configuration.
composer require pratik-dabhi/laravel-firewall
php artisan vendor:publish --tag="firewall-migrations"
php artisan migrate
php artisan vendor:publish --tag="firewall-config"
php artisan vendor:publish --tag="firewall-views"
Register middleware in Laravel 12 (bootstrap/app.php):
->withMiddleware(function (Middleware $middleware) {
$middleware->alias([
'firewall' => \PratikDabhi\Firewall\Middleware\Firewall::class,
]);
})
Protect routes:
Route::middleware(['firewall'])->group(function () {
Route::get('/', fn() => 'Protected Page');
});
Dashboard routes:
Route::get('/firewall/dashboard', fn() => view('vendor.firewall.dashboard'));
Route::get('/firewall/logs', fn() => view('vendor.firewall.logs'));
composer test
MIT License.
How can I help you explore Laravel packages today?