rabianr/laravel-ip-restrictions

Ip restrictions Middleware for Laravel

Installs: 10

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/rabianr/laravel-ip-restrictions

1.2 2022-01-31 07:55 UTC

This package is auto-updated.

Last update: 2025-09-29 02:44:02 UTC


README

Installation

composer require rabianr/laravel-ip-restrictions

Configuration

Publish the config to copy the file to your own config:

php artisan vendor:publish --tag="iprestrictions"

Usage

Set iprestrictions middleware to any route that require Basic Auth.

Define ip addresses in config/iprestrictions.php config file.

'whitelist' => array_merge([
    '1.1.1.1',
], array_filter(explode(',', env('IPRESTRICTIONS_WHITELIST', '')))),

or in .env file

IPRESTRICTIONS_WHITELIST=1.1.1.1,1.1.1.2