rabianr / laravel-ip-restrictions
Ip restrictions Middleware for Laravel
1.2
2022-01-31 07:55 UTC
Requires
- php: >=7.2
- illuminate/contracts: ^6|^7|^8|^9
- illuminate/support: ^6|^7|^8|^9
- symfony/http-foundation: ^4|^5
- symfony/http-kernel: ^4|^5
Requires (Dev)
- laravel/framework: ^6|^7|^8
- phpunit/phpunit: ^6|^7|^8|^9
This package is auto-updated.
Last update: 2025-04-29 01:22:56 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