evo-mark/evo-laravel-profanity

Use Pest's profanity wordlist in your validator
40
Install
composer require evo-mark/evo-laravel-profanity
Latest Version:v1.3.0
PHP:^8.2
License:MIT
Last Updated:Aug 1, 2026
Links: GitHub  ·  Packagist
Maintainer: evomark

Evo Laravel Profanity

This package provides a profanity validation rule that draws on the words made available in the Pest Profanity package.

Installation

You can install the package via composer:

composer require evo-mark/evo-laravel-profanity

You can publish the config file with:

php artisan vendor:publish --tag="evo-laravel-profanity-config"

Finally, to download/update the profanity definitions, add this to the composer.json file at the root of your project:

"scripts": {
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan profanity:update"
    ],
}

[!CAUTION] Failure to add the above will result in validation not running with the rule.

Usage

The validator uses your current locale for determining which profanity words to check against. Alternatively, you can set this manually in your config file. See the Pest repository for available locales.

To use the validator, simply include the profanity rule in your ruleset.

You can include/exclude additional words by publishing the config and adding them there, e.g.

return [
    'includingWords' => [
        'en' => ['soccer']
    ],
    'excludingWords' => [
        'en' => []
    ]
];

On failure, the validator will return the message in your lang/{locale}/validation file under the profanity property.

public function store(Request $request)
{
    $validated = $request->validate([
        'email' => ['required', 'string', 'email'],
        'first_name' => ['required', 'string', 'profanity'],
    ]);
}

Support Open-Source Software

We're providing this package free-of-charge. However, all development and maintenance costs time, energy and money. So please help fund this project if you can.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Licence

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

Related Packages

diego-ninja/sentinel

A content moderation and sentiment analysis library for Laravel 10+

4,960 39
yasser-elgammal/pure-text

A Laravel package for filtering and replacing inappropriate or unwanted words wi...

145 11
pestphp/pest-plugin-profanity

The Pest Profanity Plugin

34,142,087 106
mnabialek/laravel-eloquent-filter

Allows filtering Eloquent queries by input filters

14,609 25
zofe/burp

Simple PHP router that works with query-string and uri-segments, laravel filter...

198,006 18

Version History

Version Released PHP Laravel License
v1.3.0 ^8.2 ^11.0||^12.0||^13.0 MIT
v1.2.0 ^8.2 ^11.0||^12.0||^13.0 MIT
v1.1.1 ^8.2 ^11.0||^12.0 MIT
v1.1.0 ^8.2 ^11.0||^12.0 MIT
v1.0.1 ^8.2 ^11.0||^12.0 MIT