pratik-dabhi/laravel-firewall
最新稳定版本:v2.0.0
Composer 安装命令:
composer require pratik-dabhi/laravel-firewall
包简介
A powerful and extensible firewall package for Laravel 10+ supporting IP blocking, CIDR rules, rate limiting, request logging, and country blocking.
关键字:
README 文档
README
A powerful, extensible, and developer-friendly application-level firewall for Laravel 10+.
This package gives your Laravel app real-time protection through:
- 🔒 IP Blacklisting / Whitelisting
- 🌐 CIDR Blocking
- 🚫 Rate Limiting Rule Engine
- 📄 Database Logging of Security Events
- 📊 Beautiful Firewall Dashboard UI
- 📜 Detailed Logs Viewer Page
- 🧱 Plug-and-play Middleware
- ✔ Fully tested using Laravel Testbench
It brings enterprise-level request filtering & monitoring into your Laravel application with minimal configuration.
Installation
composer require pratik-dabhi/laravel-firewall
Publishing
Migrations
php artisan vendor:publish --tag="firewall-migrations"
php artisan migrate
Config
php artisan vendor:publish --tag="firewall-config"
Views
php artisan vendor:publish --tag="firewall-views"
Usage
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'));
Testing
composer test
Credits
- Pratik Dabhi
- All Contributors
License
MIT License.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-29