nickurt/laravel-pwned-passwords

PwnedPasswords for Laravel 11.x/12.x/13.x
7,791 18
Install
composer require nickurt/laravel-pwned-passwords
Latest Version:2.1
PHP:^8.2
License:MIT
Last Updated:Mar 19, 2026
Links: GitHub  ·  Packagist
Maintainer: nickurt

Laravel Pwned Passwords

Build Status Total Downloads Latest Stable Version MIT Licensed

Installation

Install this package with composer:

composer require nickurt/laravel-pwned-passwords

Copy the config files for the PwnedPasswords-plugin

php artisan vendor:publish --provider="nickurt\PwnedPasswords\ServiceProvider" --tag="config"

Examples

Validation Rule - IsPwnedPassword
// FormRequest ...

public function rules()
{
    return [
        'password' => ['required', new \nickurt\PwnedPasswords\Rules\IsPwnedPassword(20)]
    ];
}

// Manually ...

$validator = validator()->make(request()->all(), ['password' => ['required', new \nickurt\PwnedPasswords\Rules\IsPwnedPassword(20)]]);

The IsPwnedPassword-rule has one optional paramter frequency (default 10) to validate the request.

Manually Usage - IsPwnedPassword
$isPwnedPassword = \PwnedPasswords::setFrequency(20)
    ->setPassword('laravel-pwned-passwords')
    ->isPwnedPassword();
Events

You can listen to the IsPwnedPassword event, e.g. if you want to log the IsPwnedPassword-requests in your application

IsPwnedPassword Event

This event will be fired when the password is above the frequency of pwned passwords nickurt\PwnedPasswords\Events\IsPwnedPassword

Tests

composer test

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

641,106,524 9,700
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

502,645,077 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

418,291,778 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
2.1 ^8.2 ^11.0|^12.0|^13.0 MIT
2.0 ^8.2 ^11.0|^12.0 MIT
1.11 ^8.2 ^10.0|^11.0 MIT
1.10 ^8.1 ^9.0|^10.0 MIT
1.9 ^8.0|^7.4 ^6.0|^7.0|^8.0|^9.0 MIT