dilneiss/laravel-password-exposed-validation-rule

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

Maintainers

👁 dilneiss

Package info

github.com/dilneiss/laravel-password-exposed-validation-rule

pkg:composer/dilneiss/laravel-password-exposed-validation-rule

Statistics

Installs: 1 073

Dependents: 1

Suggesters: 0

Stars: 0

3.1 2024-05-29 13:01 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

LGPL-3.0-only cec9087bed85cd223417edff3791927258fb5aae

  • Jordan Hall <jordan.woop@hall05.co.uk>

This package is auto-updated.

Last update: 2026-06-29 02:14:18 UTC


README

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 divineomega/password_exposed library.

👁 Image

👁 Travis CI
👁 Coverage Status
👁 StyleCI
👁 Image

Installation

To install, just run the following Composer command.

composer require divineomega/laravel-password-exposed-validation-rule

Please note that this package requires Laravel 5.1 or above.

Usage

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

use DivineOmega\LaravelPasswordExposedValidationRule\PasswordExposed;

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

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

use DivineOmega\LaravelPasswordExposedValidationRule\PasswordExposed;

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