edenlife/superban 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

edenlife/superban

最新稳定版本:v1.1.1

Composer 安装命令:

composer require edenlife/superban

包简介

This package will add the ability to ban a client completely for a period of time

README 文档

README

Overview

Superban is a Laravel package designed to enhance your application's rate-limiting capabilities by providing the ability to ban clients completely for a specified period of time. This package integrates seamlessly with Laravel's built-in rate limiting features and allows you to configure different cache drivers such as Redis, Database, etc.

Installation

To get started with Superban, simply install the package through Composer:

composer require edenlife/superban

Configuration

In the superban.php configuration file, you can:

  1. Specify Cache Driver:
    • Choose the cache driver that Superban should use (e.g., Redis, Database).
  2. Set Ban Threshold:
    • Configure the number of requests after which a client will be banned.
  3. Define Ban Duration:
    • Specify the duration of the ban for a client after reaching the threshold.
  4. Choose Ban Criteria:
    • Decide whether to ban by user ID, IP address, email, or a combination of these.
  5. Apply Bans Globally or Per Route:
    • Choose whether to apply bans globally for all routes or specify particular routes.

Usage

To utilize Superban in your Laravel application, add the Superban middleware to the desired routes or apply it globally in your App\Http\Kernel:

protected$middleware = [
     // ... other middleware
     \SuperBanHttp\Middleware\SuperbanMiddleware::class,
     ];

Example Middleware Usage

Route::get('/protected-route', 'YourController@protectedAction')->middleware('superban:10,2,10');

Contributing

If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the GitHub repository.

License

Superban is open-sourced software licensed under the MIT License.

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固