Laravel 5.4 >
-
The Laravel Ip gateway package helps you to blacklist or whitelist IP to prevent unauthorized access.
-
Since blacklists deny access to specific entities, they are best used when a limited number of items need to be denied access. When most entities need to be denied access, a whitelist approach is more efficient
You can install the package via composer:
composer require viitorcloud/laravel-ip-gateway
After installation, You need to publish the config file for this package. This will add the file config/ip-gateway.php
, where you can configure this package.
php artisan vendor:publish --provider="LaravelIpGateway\IpGatewayProvider"
-
enable_package
is used for enable/disable access protection. -
enable_blacklist
when its true that means, It will denied access for registered ips inip-list
, false means, It will allow accessing for registered ips inip-list
. -
You can authenticated IPs through register route groups in
middleware
. -
redirect_route_to
will access URL, To redirect if denied. -
You can define all your whitelist or blacklist IP addresses inside
ip-list
.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security-related issues, please email [email protected] or [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
You can create as many whitelists or blacklist groups as you wish to protect access