luisinder / ip-control-middleware
Middleware to control access by IP
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/luisinder/ip-control-middleware
Requires
- psr/http-message: ^1.0
This package is auto-updated.
Last update: 2025-10-10 16:32:23 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"));