Skip to content
πŸ”’ Laravel validation rule that checks if a password has been exposed in a data breach.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets/images Improve README Apr 26, 2018
src Update reference to enum and set minimum PHP version to 7.1 Feb 4, 2019
tests/Unit Fix StyleCI errors Feb 16, 2019
.gitignore Add PHP Unit and basic Unit tests Feb 15, 2019
LICENSE Initial commit Apr 26, 2018
README.md Document setting custom validation message Jul 11, 2018
composer.json Update dependency version Feb 20, 2019

README.md

πŸ”’ 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 divineomega/password_exposed library.

StyleCI

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.')],
]);
You can’t perform that action at this time.