woodynadobhar/laravel-stupid-password 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

woodynadobhar/laravel-stupid-password

最新稳定版本:v1.0

Composer 安装命令:

composer require woodynadobhar/laravel-stupid-password

包简介

A laravel package wrapper for northox/stupid-password

README 文档

README

Latest Version on Packagist Total Downloads

A Laravel package wrapper for Northox Stupid Password.

Installation

Install the package via Composer:

composer require woodynadobhar/laravelstupidpassword

Publish the configuration file:

php artisan vendor:publish --provider="WoodyNaDobhar\\LaravelStupidPassword\\LaravelStupidPasswordServiceProvider" --tag=config

This will create a configuration file at config/laravelstupidpassword.php.

Usage

Automatically

To enforce password strength validation, simply add stupidpassword to your validation rules:

'password' => 'min:6|required_with:password_confirmation|same:password_confirmation|stupidpassword',

Manually

You can also validate passwords manually by using the LaravelStupidPassword class:

use WoodyNaDobhar\LaravelStupidPassword\LaravelStupidPassword;

$stupidPass = new LaravelStupidPassword(
    config('laravelstupidpassword.max'),
    config('laravelstupidpassword.environmentals'),
    null,
    null,
    config('laravelstupidpassword.options')
);

if (!$stupidPass->validate($input['password'])) {
    $errors = implode(' ', $stupidPass->getErrors());
    throw new \Exception("Your password is too weak: $errors");
}

Configuration

The configuration file laravelstupidpassword.php allows customization of the following options:

  • max: Maximum number of passwords to evaluate.
  • environmentals: An array of additional weak passwords to consider.
  • options: Advanced configuration options specific to the Northox Stupid Password library.

Dependencies

This package is a Laravel wrapper for Northox Stupid Password.

Change Log

Please see the CHANGELOG for details on recent changes.

Contributing

See CONTRIBUTING for guidelines and a to-do list.

Security

If you discover any security-related issues, please contact the Northox Stupid Password repository owner.

Versioning

This package follows Semantic Versioning (SemVer). Updates are published to Packagist.

Credits

License

This package is licensed under the BSD License. In other words, it is free software.

统计信息

  • 总下载量: 1.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-06-18