Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Firewall Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Laravel Firewall

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor