Download the PHP package sagarkc/laravel-bot-throttle without Composer
On this page you can find all versions of the php package sagarkc/laravel-bot-throttle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sagarkc/laravel-bot-throttle
More information about sagarkc/laravel-bot-throttle
Files in sagarkc/laravel-bot-throttle
Package laravel-bot-throttle
Short Description Advanced bot detection and request throttling package for Laravel by Sagar KC
License MIT
Informations about the package laravel-bot-throttle
Laravel Bot Throttle by Sagar KC
Laravel Bot Throttle is an advanced middleware package for Laravel to detect and block bots, throttle abuse, and protect your routes. Developed and maintained by Sagar KC
๐ Features
- ๐ก๏ธ Detects bots based on User-Agent patterns
- โ Temporarily bans malicious IPs via cache
- ๐ Logs bot activity to a dedicated log file (
botthrottle.log
) - ๐ Customizable request throttling per IP and route
- โ๏ธ IP whitelisting and block control
- ๐งฉ Fully configurable via
config/botthrottle.php
๐ฆ Installation
๐ ๏ธ Publish the Config File
This will publish config/botthrottle.php
which allows full customization, you can add the list of bots as per your need.
๐ Optional: Enable Custom Bot Log File
To log bot activity in a separate file (storage/logs/botthrottle.log
), add the following line to the channels
array in your config/logging.php
file:
This merges the custom botthrottle
log channel defined in config/botthrottle.php
into Laravel's logging system.
After this, all blocked bots will be logged in
botthrottle.log
instead of the defaultlaravel.log
.
๐งช Usage
Apply middleware to your routes:
โ๏ธ Configuration Example
๐ View Blocked IPs (Programmatically)
๐ License
MIT ยฉ Sagar KC
๐ Contributing
Pull requests and issues are welcome. Please fork the repository and open a PR with improvements or bug fixes.