rabianr/laravel-ip-restrictions

Ip restrictions Middleware for Laravel

1.2 2022-01-31 07:55 UTC

This package is auto-updated.

Last update: 2024-04-29 04:53:47 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