This metapackage installs the maintained rule that validates that a field is not offensive. It can be useful for user-supplied data that may be displayed publicly, such as usernames or comments.
composer require laravel-validation-rules/offensiveuse JordJD\LaravelOffensiveValidationRule\Offensive;
$request->validate([
'username' => ['required', new Offensive],
]);You can also provide custom offensive-word blacklists and whitelists. See the maintained package documentation for the current extension points.
Version 2 of this metapackage uses the current jord-jd/laravel-offensive-validation-rule package and namespace. Applications that still use the legacy DivineOmega namespace should remain on version 1 until they are ready to update the import.
This project is licensed under a GNU Lesser General Public License v3.0 which you can find in this LICENSE.
If you have any feedback, comments or suggestions, please feel free to open an issue within this repository.
This package is part of the Laravel Validation Rules collection. If you're after more useful validation rules, head to the Laravel Validation Rules website.