Skip to content

steadfast-collective/laravel-bad-word

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Bad Word

This package is a fork of patoui/laravel-bad-word for use with Laravel 9. It adds a "bad_word" validation rule which check for profanity and any words you want to add to check against!

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.',

About

A "bad_word" validation rule made for Laravel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%