LaravelPackages.net
Acme Inc.
Toggle sidebar
webhubworks/laravel-unusual-login

This is my package laravel-unusual-login

162
0
1.1.5
About webhubworks/laravel-unusual-login

webhubworks/laravel-unusual-login is a Laravel package for this is my package laravel-unusual-login. It currently has 0 GitHub stars and 162 downloads on Packagist (latest version 1.1.5). Install it with composer require webhubworks/laravel-unusual-login. Discover more Laravel packages by webhubworks or browse all Laravel packages to compare alternatives.

Last updated

Installation

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.

Comments