PHPackages                             owowagency/laravel-profanity-validation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. owowagency/laravel-profanity-validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

owowagency/laravel-profanity-validation
=======================================

Filters out profanities from strings using validation.

v0.1.0(3y ago)02.0k↓33.3%1MITPHPPHP &gt;=8.1

Since Feb 15Pushed 3y agoCompare

[ Source](https://github.com/owowagency/laravel-profanity-validation)[ Packagist](https://packagist.org/packages/owowagency/laravel-profanity-validation)[ RSS](/packages/owowagency-laravel-profanity-validation/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Profanity Filter
================

[](#profanity-filter)

A simple class to test if a string has a profanity in it.

Checks performed
----------------

[](#checks-performed)

### Straight matching

[](#straight-matching)

Checks string for profanity as it is against list of bad words. E.g. `badword`

### Substitution

[](#substitution)

Checks string for profanity with characters substituted for each letter. E.g. `bâdΨ0rd`

### Obscured

[](#obscured)

Checks string for profanity obscured with punctuation between. E.g. `b|a|d|w|o|r|d`

### Doubled

[](#doubled)

Check string for profanity that has characters doubled up. E.g. `bbaaddwwoorrdd`

### Combinations

[](#combinations)

Also works with combinations of the above. E.g. `b|â|d|Ψ|0|rr|d`

Installation
------------

[](#installation)

Install this package via composer.

```
php composer.phar require developer/profanity-filter

```

Usage
-----

[](#usage)

```
/* default constructor */
$check = new Check();
$hasProfanity = $check->hasProfanity($badWords);
$cleanWords = $check->obfuscateIfProfane($badWords);

/* customized word list from file */
$check = new Check('path.to/wordlist.php');

/* customized word list from array */
$badWords = array('bad', 'words'); // or load from db
$check = new Check($badWords);
```

Kudos
-----

[](#kudos)

Have to mention the following project as it gave me a good foundation for the regex and a list of swear words.

Thanks to @jackcsk for his contribution, adding the ability to use a plain array instead of a file for the list of profanities. Available in version &gt; v1.3.0.

### License

[](#license)

ProfanityFilter is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

3

Last Release

1174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b0064d818f9593dfb4f9d86217bbf5f14961ad6779b84fd5546dd91f296d898?d=identicon)[dees040](/maintainers/dees040)

---

Top Contributors

[![developerdino](https://avatars.githubusercontent.com/u/747501?v=4)](https://github.com/developerdino "developerdino (67 commits)")[![AmineFarhaoui](https://avatars.githubusercontent.com/u/55694847?v=4)](https://github.com/AmineFarhaoui "AmineFarhaoui (10 commits)")[![jackcsk](https://avatars.githubusercontent.com/u/421731?v=4)](https://github.com/jackcsk "jackcsk (6 commits)")[![dees040](https://avatars.githubusercontent.com/u/5390555?v=4)](https://github.com/dees040 "dees040 (4 commits)")[![darrennolan](https://avatars.githubusercontent.com/u/1115755?v=4)](https://github.com/darrennolan "darrennolan (1 commits)")[![covienam](https://avatars.githubusercontent.com/u/10507992?v=4)](https://github.com/covienam "covienam (1 commits)")[![salvo1404](https://avatars.githubusercontent.com/u/5450842?v=4)](https://github.com/salvo1404 "salvo1404 (1 commits)")[![YouneselBarnoussi](https://avatars.githubusercontent.com/u/16510310?v=4)](https://github.com/YouneselBarnoussi "YouneselBarnoussi (1 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/owowagency-laravel-profanity-validation/health.svg)

```
[![Health](https://phpackages.com/badges/owowagency-laravel-profanity-validation/health.svg)](https://phpackages.com/packages/owowagency-laravel-profanity-validation)
```

###  Alternatives

[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1036.7k3](/packages/carsdotcom-laravel-json-schema)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
