Download the PHP package chrishardie/laravel-synced-ip-allowlist without Composer
On this page you can find all versions of the php package chrishardie/laravel-synced-ip-allowlist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chrishardie/laravel-synced-ip-allowlist
More information about chrishardie/laravel-synced-ip-allowlist
Files in chrishardie/laravel-synced-ip-allowlist
Package laravel-synced-ip-allowlist
Short Description A Laravel package that provides HTTP middleware to allow access from a centralized list of IPs
License MIT
Homepage https://github.com/chrishardie/laravel-synced-ip-allowlist
Informations about the package laravel-synced-ip-allowlist
Laravel Synced IP Allowlist
A Laravel package that provides HTTP middleware to allow access from a centralized list of IPs
Installation
You can install the package via composer:
Set Up Variables
If you haven't already, generate an encryption key to use across all apps retrieving the list of IP addresses.
Copy the key to a secure location and store it in the ALLOWED_IPS_KEY
environment variable, see below.
Open .env
and define these variables:
If you want to further change package behavior, you can optionally publish the config file with:
This is the contents of the published config file:
Usage
Encrypting and Publicizing Allowed IPs
Encrypt your list of IP addresses:
Paste or type in the list of IPs and get the encrypted result:
Take the encrypted result and put it at a URL that will be accessible to the applications using this package, e.g. https://example.com/allowed-ips.txt
Run Initial Sync
Result:
Future Syncs are Scheduled
The sync process will run twice daily:
Use the Middleware to Protect a Route
In app/Http/Kernel.php
, add an entry to the list of named, available HTTP route middleware:
Then, in your routes file routes/web.php
:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-synced-ip-allowlist with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0