Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/divineomega/laravel-password-exposed-validation-rule
🔒 Laravel validation rule that checks if a password has been exposed in a data breach.
https://github.com/divineomega/laravel-password-exposed-validation-rule
data-breach laravel laravel-5-package laravel-validation passwords php security
Last synced: about 2 hours ago
JSON representation
🔒 Laravel validation rule that checks if a password has been exposed in a data breach.
- Host: GitHub
- URL: https://github.com/divineomega/laravel-password-exposed-validation-rule
- Owner: DivineOmega
- License: lgpl-3.0
- Created: 2018-04-26T21:49:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-31T13:39:54.000Z (almost 2 years ago)
- Last Synced: 2025-01-19T18:07:13.440Z (7 days ago)
- Topics: data-breach, laravel, laravel-5-package, laravel-validation, passwords, php, security
- Language: PHP
- Homepage:
- Size: 64.5 KB
- Stars: 90
- Watchers: 8
- Forks: 33
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🔒 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`](https://github.com/DivineOmega/password_exposed) library.
## 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.
```php
use DivineOmega\LaravelPasswordExposedValidationRule\PasswordExposed;$request->validate([
'password' => ['required', new PasswordExposed()],
]);
```If you wish, you can also set a custom validation message, as shown below.
```php
use DivineOmega\LaravelPasswordExposedValidationRule\PasswordExposed;$request->validate([
'password' => ['required', (new PasswordExposed())->setMessage('This password is not secure.')],
]);
```