You can install the package via composer:
composer require schwarzer/laravel-rules
Please consider reading the Laravel Docs first.
In the next major release you'll be able to set the API key by config.
This rule is inspired by valorin/pwned-validator.
Please add to your /resources/lang/{lang}/validation.php
file the following line:
'hibp' => 'The :attribute occurs at least :min times in a list of known passwords.',
'hibp' => 'Das :attribute kommt mindestens :min mal in einer Liste bekannter Passwörter vor.',
Validator::make($request->all(), [
'password' => 'required|hibp',
]);
You can specify how often your password (hash) should be found min
imum in the HIBP results.
Validator::make($request->all(), [
'password' => 'required|hibp:min=1',
]);
Validator::make($request->all(), [
'password' => ['required', new HaveIBeenPwned],
]);
You can specify how often your password (hash) should be found minimum in the HIBP results.
Validator::make($request->all(), [
'password' => ['required', new HaveIBeenPwned(1)],
]);
composer test
Please see CHANGELOG for more information what has changed recently.
The MIT License (MIT). Please see License File for more information.