Download the PHP package xultech/laravel-ip-whitelist without Composer
On this page you can find all versions of the php package xultech/laravel-ip-whitelist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xultech/laravel-ip-whitelist
More information about xultech/laravel-ip-whitelist
Files in xultech/laravel-ip-whitelist
Package laravel-ip-whitelist
Short Description Laravel middleware package for IP whitelisting with CIDR and wildcard support.
License MIT
Informations about the package laravel-ip-whitelist
Laravel IP Whitelist
A flexible, modern Laravel middleware package to protect your application using configurable IP whitelisting. Supports CIDR blocks, wildcards, exact IPs, and storage via config or database.
✨ Features
- ✅ Match IPs using:
- Exact match (e.g.
123.45.67.89
) - Wildcard (e.g.
192.168.*.*
) - CIDR blocks (e.g.
10.0.0.0/24
)
- Exact match (e.g.
- ✅ Configurable storage (config or database)
- ✅ Middleware protection
- ✅ Blade directives
- ✅ Route macros
- ✅ Facade + helper function
- ✅ Artisan commands for managing IPs
📦 Installation
Laravel will auto-discover the service provider and alias.
⚙️ Configuration
Publish the config file:
Or create a custom config/ipwhitelist.php
:
🛡️ Usage
Middleware
Add globally in Http\Kernel.php
:
For Laravel 11+:
Add to your bootstrap/app.php
file:
Apply to a route:
Route Macro
Blade Directive
Facade
Helper
🧩 Using the Model
This package includes a built-in Eloquent model you can use to manage whitelisted IPs via database.
-
Run the migration: No need to publish anything. The package automatically loads its migration.
This creates the
ip_whitelist_entries
table (or your custom name, based on config). -
Use the model in your code:
You do not need to publish the model — it is fully usable directly from the package.
🛠 Customize the Table Name
In
config/ipwhitelist.php
, you can change:
To create a custom table name like:
⚡ Artisan Commands
Command | Description |
---|---|
ipwhitelist:add {ip} |
Add IP to the whitelist |
ipwhitelist:remove {ip} |
Remove IP from the whitelist |
ipwhitelist:list |
List whitelisted IPs |
Or, with example usage included directly under: Examples:
🧪 Testing
The package uses Pest and Orchestra Testbench for testing.
Run the test suite:
✅ Requirements / Compatibility
- PHP: 7.3 – 8.4+
- Laravel: 6.x, 7.x, 8.x, 9.x, 10.x, 11.x, 12.x
This package is tested across multiple Laravel versions and follows Laravel's release cycle. It works out of the box with both long-term support (LTS) and the latest Laravel versions.
📄 License
This package is open-sourced software licensed under the MIT license.
🤝 Contributing
Contributions are welcome and appreciated!
To contribute:
- Fork this repository
-
Create a new branch for your feature or fix:
- Make your changes with clear, descriptive commits
- Write or update tests if applicable
-
Run the test suite to make sure everything passes:
- Push your branch:
- Open a Pull Request and describe your changes
🧭 Guidelines
- Follow PSR-12 coding standards
- Keep pull requests focused and minimal
- For large changes, consider opening an issue first to discuss
Thank you for helping improve Laravel IP Whitelist!
👥 Credits & Authors
Laravel IP Whitelist was crafted with care by Michael Erastus under XulTech as part of our mission to build secure and developer-friendly Laravel tools.
🧑💻 Core Maintainer
🤝 Contributors
Special thanks to everyone who provided feedback, reported issues, or helped shape the direction of this package. Your support makes open source better.
If you find this package helpful, consider giving it a ⭐️ on GitHub or sharing it with others in the Laravel community.
For contributions, ideas, or collaborations, feel free to reach out!