luisinder / ip-control-middleware
Middleware to control access by IP
1.2
2016-10-26 14:44 UTC
Requires
- psr/http-message: ^1.0
This package is auto-updated.
Last update: 2024-12-20 04:30:52 UTC
README
Middleware to control the IPs that have access to the application.
- Allows adding multiple IPs.
- Defines a return URL in case the IP is not allowed.
Installation
Using Composer:
$ composer require luisinder/ip-control-middleware
Use
Allowed IPs must be inside an array. The second parameter is the return URL in case of failure:
$app->add(new Luisinder\Middleware\IpControl(['::1','192.168.1.0','127.0.0.1'],"https://github.com"));