luisinder/ip-control-middleware

Middleware to control access by IP

1.2 2016-10-26 14:44 UTC

This package is auto-updated.

Last update: 2024-04-20 03:12:56 UTC


README

Latest Stable Version Total Downloads

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"));