smony/filament-login-attempts 问题修复 & 功能扩展

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

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

smony/filament-login-attempts

Composer 安装命令:

composer require smony/filament-login-attempts

包简介

Log login attempts to your Filament admin panel and protect it from brute-force attacks.

README 文档

README

Filament Login Attempts

Latest Version Total Downloads License

Log every login attempt to your Filament admin panel and lock out brute-force attackers automatically, right from your Filament admin panel.

Requirements

  • PHP 8.2+
  • Filament v4

Installation

composer require smony/filament-login-attempts

Publish and run the migration:

php artisan vendor:publish --tag=filament-login-attempts-migrations
php artisan migrate

Register the plugin in your Panel Provider:

use Smony\FilamentLoginAttempts\FilamentLoginAttemptsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(FilamentLoginAttemptsPlugin::make());
}

What you get

  • A Login Attempts page listing every login attempt: email, matched user (or "Guest"), IP address, parsed device/browser, success/failure, and when it happened
  • Brute-force protection: after a configurable number of failed attempts, the offending IP, email, or IP+email combination is locked out for a configurable duration — enforced via Laravel's RateLimiter, the same mechanism behind the framework's own login throttling
  • A "Currently locked out" filter and an "Unlock now" action to lift a lockout early
  • A stats widget showing failed attempts in the last 24 hours and how many keys are currently locked out
  • A login-attempts:prune artisan command to delete attempts older than your retention window
  • A Smony\FilamentLoginAttempts\Events\LoginLockedOut event, dispatched the moment a key gets locked out — listen for it in your app to send your own notification (Slack, email, etc.):
use Smony\FilamentLoginAttempts\Events\LoginLockedOut;

Event::listen(LoginLockedOut::class, function (LoginLockedOut $event) {
    // $event->key, $event->email, $event->ipAddress, $event->lockedForMinutes
});

Configuration

Publish the config to customize thresholds, the lockout key strategy, and retention:

php artisan vendor:publish --tag=filament-login-attempts-config
return [
    'table' => 'login_attempts',
    'max_attempts' => 5,
    'decay_minutes' => 10,
    'lockout_minutes' => 15,
    'lockout_strategy' => 'ip_and_email', // ip | email | ip_and_email
    'retention_days' => 30,
];

Schedule the prune command in your app's console kernel/scheduler to keep the table from growing indefinitely:

$schedule->command('login-attempts:prune')->daily();

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固