nickurt/laravel-pwned-passwords
最新稳定版本:2.1
Composer 安装命令:
composer require nickurt/laravel-pwned-passwords
包简介
PwnedPasswords for Laravel 11.x/12.x/13.x
README 文档
README
Installation
Install this package with composer:
composer require nickurt/laravel-pwned-passwords
Copy the config files for the PwnedPasswords-plugin
php artisan vendor:publish --provider="nickurt\PwnedPasswords\ServiceProvider" --tag="config"
Examples
Validation Rule - IsPwnedPassword
// FormRequest ... public function rules() { return [ 'password' => ['required', new \nickurt\PwnedPasswords\Rules\IsPwnedPassword(20)] ]; } // Manually ... $validator = validator()->make(request()->all(), ['password' => ['required', new \nickurt\PwnedPasswords\Rules\IsPwnedPassword(20)]]);
The IsPwnedPassword-rule has one optional paramter frequency (default 10) to validate the request.
Manually Usage - IsPwnedPassword
$isPwnedPassword = \PwnedPasswords::setFrequency(20) ->setPassword('laravel-pwned-passwords') ->isPwnedPassword();
Events
You can listen to the IsPwnedPassword event, e.g. if you want to log the IsPwnedPassword-requests in your application
IsPwnedPassword Event
This event will be fired when the password is above the frequency of pwned passwords
nickurt\PwnedPasswords\Events\IsPwnedPassword
Tests
composer test
统计信息
- 总下载量: 7.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-26