承接 ryangurn/laravel-bad-word 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ryangurn/laravel-bad-word

Composer 安装命令:

composer require ryangurn/laravel-bad-word

包简介

Laravel bad word validation rule

README 文档

README

This package adds a "bad_word" validation rule which check for profanity and any words you want to add to check against!

Installation

This package can be used in Laravel 5.0 or higher.

You can install the package via composer:

composer require patoui/laravel-bad-word

In Laravel 5.5 the service provider will automatically get registered. For older versions of the framework, add the service provider in config/app.php file:

'providers' => [
    // ...
    Patoui\LaravelBadWord\BadWordServiceProvider::class,
];

Usage

For all languages use the following

'field_name' => 'bad_word'

For a specific language(s), the syntax is as shown in the snippet below (you may select any array key found in the config)

'field_name' => 'bad_word:en,fr' // english and french only

Configuration

To publish the configuration file to config/bad-word.php

php artisan vendor:publish --provider="Patoui\LaravelBadWord\BadWordServiceProvider"

You may add your own language keys as needed

'dothraki' => ['Mel ase']

// can be referenced in validation
'field_name' => 'bad_word:dothraki'

Be sure to add a validation message to your validation.php file

'bad_word' => 'The :attribute cannot contain bad words.',

Contributions

Any contributions are welcome!

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固