swatty007/laravel-context-prohibited-rule 问题修复 & 功能扩展

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

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

swatty007/laravel-context-prohibited-rule

Composer 安装命令:

composer require swatty007/laravel-context-prohibited-rule

包简介

Simple validation rule to disallow application related words within passwords.

README 文档

README

Package Banner

Latest Version on Packagist License: MIT Build Status Code Style Quality Score Total Downloads

Simple validation rule to disallow application related words within passwords. Its checks that the entered data does not contain your application name, or url to prevent users weakening their passwords.

Installation

You can install the package via composer:

composer require swatty007/laravel-context-prohibited-rule

Laravel's service provider discovery will automatically configure our service provider for you.

Add the validation message to your validation lang file:

For each language add a validation message to validation.php like below

'context_prohibited' => 'Your :attribute shall not contain any of the following words: :prohibited',

Configuration

After installing the package you can publish the configuration file via:

php artisan vendor:publish --provider="Swatty007\LaravelContextProhibitedRule\ContextProhibitedServiceProvider"

It contains some optional configuration parameters and is fully documented.

Usage

After installation, the php context_prohibited validator will be available for use directly in your validation rules.

'password' => 'context_prohibited'
// or preferred
'password' => ['required', new ContextProhibited],

For error message to work correctly you should prefer to initialize the rule object!

Within the context of a registration form, it would look like this:

return Validator::make($data, [
    'name' => 'required|string|max:255',
    'email' => 'required|string|email|max:255|unique:users',
    'password' => 'required|string|min:8|context_prohibited|confirmed',
]);

Testing

Yes we do!

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

TODO

  • Currently None

Pull Requests are welcome 🧐

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@martin-niehoff.de instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固