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
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-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