webhubworks/laravel-unusual-login 问题修复 & 功能扩展

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

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

webhubworks/laravel-unusual-login

最新稳定版本:1.0.12

Composer 安装命令:

composer require webhubworks/laravel-unusual-login

包简介

This is my package laravel-unusual-login

README 文档

README

You can install the package via composer:

composer require webhubworks/laravel-unusual-login

You can publish the config and migration files with:

php artisan unusual-login:install

Finally, you can run the migrations with:

php artisan migrate

Alternatively, you can publish the config file only with:

php artisan vendor:publish --tag="unusual-login-config"

Usage

This package listens to the Illuminate\Auth\Events\Attempting and Illuminate\Auth\Events\Login events.
On the Login event it will run through the checks defined in the config file.
If the specified threshold is reached, the package will fire the Webhubworks\LaravelUnusualLogin\Events\UnusualLoginDetected event.
Additionally, you may specify a notification the package will automatically send out.

You may create custom checks. Simply refer to a given check in src/Checks.
Your check must extend the Webhubworks\LaravelUnusualLogin\Checks\Check class and implement the handle method.
It receives and returns the WebhubWorks\UnusualLogin\DTOs\UnusualLoginDetected DTO object.

Cleaning / Purging

< Laravel 11.0

In the Kernel.php file add the following to the schedule method:

// in app/Console/Kernel.php
use Webhubworks\LaravelUnusualLogin\Commands\PurgeLoginAttemptsCommand;

protected function schedule(Schedule $schedule)
{
    $schedule->command(PurgeLoginAttemptsCommand::class)->daily();
}

>= Laravel 11.0

On the routes/console.php add the following lines:

use Webhubworks\LaravelUnusualLogin\Commands\PurgeLoginAttemptsCommand;

Schedule::command(PurgeLoginAttemptsCommand::class)->daily();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-25