bluenest/laravel-ip-restriction-middleware

Laravel middleware to allow restricting HTTP requests by IP addresses.

dev-master 2018-01-15 02:00 UTC

This package is auto-updated.

Last update: 2024-11-12 08:32:42 UTC


README

Laravel middleware for restricting HTTP access by IP address or addresses.

Installation

Add via composer:

composer require bluenest/laravel-ip-restriction-middleware

Then add the following middleware in app/Http/kernel.php:

\BlueNest\Laravel\Http\Middleware\IpRestrictionMiddleware::class,

Configuration

Add the following configuration settings in your .env file:

IP_ACCESS_ALLOW_DENY_DEFAULT=DENY
IP_ACCESS_BLACKLIST=
IP_ACCESS_WHITELIST=127.0.0.1
IP_ACCESS_DENY_MESSAGE="Please contact an administrator"
IP_ACCESS_DENY_HTTP_STATUS_CODE=500
IP_ACCESS_LOG_DENIALS=true