enkuldes / listing-ip-address
Whitelisting/Blacklisting IP Address
Requires
- php: >=7.2
- illuminate/support: ^6|^7|^8|^9
Requires (Dev)
- orchestra/testbench: ^6.25
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-05-24 13:48:16 UTC
README
This is my very first package that I have to publish. The basic function is to whatever check IP Address of client is being blacklist/whitelist to access the page.
Installation
You can install the package via composer:
composer require enkuldes/listing-ip-address
Export the config file with:
php artisan vendor:publish --provider="EnKuldes\ListingIPAddress\ListingIPAddressServiceProvider"
And after that add this following line on .ENV
file:
# List of IP Address separated by comma (,) LIST_IP=192.168.0.5,10.194.17.10,127.0.0.1 # How middleware React to List of IP. Either blacklist or whitelist. Default BlackList. BEHAVIOR=whitelist
Usage
Add middleware to route file, example:
// Add middleware to single route Route::get('/', 'HomeController@index')->middleware('listing-ip-address'); // Add middleware to group route Route::middleware(['listing-ip-address'])->group(function () { Route::get('/', 'HomeController@index'); };
Testing
composer test
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 fahmuzaki@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.