Download the PHP package orkhanahmadov/laravel-ip-middleware without Composer
On this page you can find all versions of the php package orkhanahmadov/laravel-ip-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download orkhanahmadov/laravel-ip-middleware
More information about orkhanahmadov/laravel-ip-middleware
Files in orkhanahmadov/laravel-ip-middleware
Package laravel-ip-middleware
Short Description Laravel middleware for whitelisting/blacklisting client IP addresses
License MIT
Homepage https://github.com/orkhanahmadov/laravel-ip-middleware
Informations about the package laravel-ip-middleware
Laravel IP middleware
Laravel middleware for whitelisting/blacklisting client IP addresses
Requirements
- PHP 8.0 or higher
- Laravel 8 or higher
Installation
You can install the package via composer:
Usage
Packages comes with WhitelistMiddleware
and BlacklistMiddleware
middlewares.
You can register any or both of them in $routeMiddleware
in app/Http/Kernel.php
file:
Use middlewares in any of your routes and pass IP addresses.
ip_whitelist
middleware will block any requests where client IP not matching with whitelisted IPs.ip_blacklist
middleware will block requests coming from blacklisted IPs.
You can also pass multiple IP addresses separated with comma:
This will block all requests where client IP not matching whitelisted IP list.
Package also allows setting predefine IP list in config and use them with name:
Configuration
Run this command to publish package config file:
ip-middleware.php
config file contains following settings:
ignore_environments
- Middleware ignores IP checking when application is running in listed environments.error_code
- HTTP code that shown when request gets rejected.custom_server_parameter
- Custom $_SERVER parameter to look for IP addresspredefined_lists
- Predefined IP lists
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Orkhan Ahmadov
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-ip-middleware with dependencies
illuminate/contracts Version ^8.0|^9.0|^10.0|^11.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0