PHP code example of smony / filament-login-attempts

1. Go to this page and download the library: Download smony/filament-login-attempts library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

smony / filament-login-attempts example snippets


use Smony\FilamentLoginAttempts\FilamentLoginAttemptsPlugin;

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

use Smony\FilamentLoginAttempts\Events\LoginLockedOut;

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

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->command('login-attempts:prune')->daily();
bash
php artisan vendor:publish --tag=filament-login-attempts-migrations
php artisan migrate
bash
php artisan vendor:publish --tag=filament-login-attempts-config