PHPackages                             jord-jd/laravel-password-exposed-validation-rule - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. jord-jd/laravel-password-exposed-validation-rule

ActiveLibrary[Security](/categories/security)

jord-jd/laravel-password-exposed-validation-rule
================================================

Laravel validation rule that checks if a password has been exposed in a data breach

v6.1.0(1mo ago)89644↓77.9%421LGPL-3.0-onlyPHPPHP ^7.4||^8.0CI passing

Since Apr 26Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/Jord-JD/laravel-password-exposed-validation-rule)[ Packagist](https://packagist.org/packages/jord-jd/laravel-password-exposed-validation-rule)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/jord-jd-laravel-password-exposed-validation-rule/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (6)Versions (21)Used By (1)

🔒 Laravel Password Exposed Validation Rule
==========================================

[](#-laravel-password-exposed-validation-rule)

This package provides a Laravel validation rule that checks if a password has been exposed in a data breach. It uses the haveibeenpwned.com passwords API via the [`jord-jd/password_exposed`](https://github.com/Jord-JD/password_exposed) library.

```
// composer require jord-jd/laravel-password-exposed-validation-rule

use JordJD\LaravelPasswordExposedValidationRule\PasswordNotExposed;

$request->validate([
    'password' => ['required', new PasswordNotExposed()],
]);
```

Compatibility
-------------

[](#compatibility)

- PHP: 7.4+ and 8.x
- Laravel: 8.x through 13.x

Installation
------------

[](#installation)

To install, just run the following Composer command.

```
composer require jord-jd/laravel-password-exposed-validation-rule

```

Please note that this package requires Laravel 8.0 or above.

Usage
-----

[](#usage)

The following code snippet shows an example of how to use the password exposed validation rule.

```
use JordJD\LaravelPasswordExposedValidationRule\PasswordNotExposed;

$request->validate([
    'password' => ['required', new PasswordNotExposed()],
]);
```

If you wish, you can also set a custom validation message, as shown below.

```
use JordJD\LaravelPasswordExposedValidationRule\PasswordNotExposed;

$request->validate([
    'password' => ['required', (new PasswordNotExposed())->setMessage('This password is not secure.')],
]);
```

Backward Compatibility
----------------------

[](#backward-compatibility)

`PasswordExposed` remains available as a backwards-compatible alias for `PasswordNotExposed`.

Testing / Mocking
-----------------

[](#testing--mocking)

If you need deterministic tests, you can inject a checker directly or use a resolver.

```
use JordJD\LaravelPasswordExposedValidationRule\PasswordNotExposed;
use JordJD\PasswordExposed\Interfaces\PasswordExposedCheckerInterface;

$fakeChecker = new class implements PasswordExposedCheckerInterface {
    // Implement interface methods for your test scenario...
};

PasswordNotExposed::resolvePasswordExposedCheckerUsing(function () use ($fakeChecker) {
    return $fakeChecker;
});
```

Non-string values are left to Laravel's other validation rules, so combine this rule with `string` when the field must contain text. Objects that implement `__toString()` are checked normally.

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance94

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 82.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~158 days

Recently: every ~38 days

Total

20

Last Release

32d ago

Major Versions

v1.2.3 → v2.0.02019-02-04

v2.5.0 → v4.0.02026-02-14

v4.0.0 → v5.0.02026-02-14

v5.0.1 → v6.0.02026-02-16

PHP version history (4 changes)v2.0.0PHP ^7.1

v2.4.0PHP ^7.1||^8.0

v2.5.0PHP ^7.1||^8.0||8.1

v6.0.0PHP ^7.4||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (51 commits)")[![jameswilddev](https://avatars.githubusercontent.com/u/3138458?v=4)](https://github.com/jameswilddev "jameswilddev (6 commits)")[![SteJaySulli](https://avatars.githubusercontent.com/u/60765965?v=4)](https://github.com/SteJaySulli "SteJaySulli (3 commits)")[![janpio](https://avatars.githubusercontent.com/u/183673?v=4)](https://github.com/janpio "janpio (1 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (1 commits)")

---

Tags

data-breachlaravellaravel-5-packagelaravel-validationpasswordsphpsecurity

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jord-jd-laravel-password-exposed-validation-rule/health.svg)

```
[![Health](https://phpackages.com/badges/jord-jd-laravel-password-exposed-validation-rule/health.svg)](https://phpackages.com/packages/jord-jd-laravel-password-exposed-validation-rule)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[illuminate/encryption

The Illuminate Encryption package.

9631.1M360](/packages/illuminate-encryption)[moonshine/moonshine

Laravel administration panel

1.3k268.2k89](/packages/moonshine-moonshine)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

731189.9k16](/packages/tallstackui-tallstackui)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
