PHPackages                             imliamxo/shush - 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. [Search &amp; Filtering](/categories/search)
4. /
5. imliamxo/shush

ActiveLibrary[Search &amp; Filtering](/categories/search)

imliamxo/shush
==============

A configurable profanity filter for Laravel. Block or censor profanity with multi-language support.

v1.0.0(2mo ago)00MITPHPPHP ^8.1

Since Apr 10Pushed 2mo agoCompare

[ Source](https://github.com/imLiaMxo/Shush)[ Packagist](https://packagist.org/packages/imliamxo/shush)[ RSS](/packages/imliamxo-shush/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

🤫 Shush
=======

[](#-shush)

A configurable, multi-language profanity filter for Laravel with **severity tiers**, **per-language normalisers**, and **evasion-resistant detection**.

Catches `shit`, `sh!t`, `sh1t`, `$h!t`, `shiiit`, `sshit`, `s.h.i.t` — and everything in between. Ships with extensive English and Polish dictionaries out of the box.

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

[](#installation)

```
composer require imliamxo/shush
```

```
php artisan vendor:publish --tag=shush-config
php artisan vendor:publish --tag=shush-dictionaries   # optional
```

Quick Start
-----------

[](#quick-start)

```
use ImLiaMxo\Shush\Facades\Shush;

Shush::check('Hello world');           // false
Shush::check('What the fuck');         // true
Shush::check('What the f*ck');         // true
Shush::check('What the f.u.c.k');      // true
Shush::check('What the fuuuck');       // true
Shush::check('No kurwa mać');          // true (Polish, if enabled)

Shush::censor('What the fuck');        // "What the ****"
Shush::clean($text);                   // censors or throws, per config

$hits = Shush::detect('Shit and kurwa');
// [
//   ['word' => 'shit', 'tier' => 'moderate', 'language' => 'en', 'match' => 'Shit'],
//   ['word' => 'kurwa', 'tier' => 'severe', 'language' => 'pl', 'match' => 'kurwa'],
// ]
```

Strictness Levels
-----------------

[](#strictness-levels)

Words are categorised into three severity tiers. The `strictness` setting controls which tiers are active:

StrictnessTiers caughtUse case`relaxed`severe onlyCatch slurs &amp; hate speech, allow swearing`normal`severe + moderateBlock strong profanity (default)`strict`severe + moderate + mildFamily-friendly, zero tolerance```
// Global
'strictness' => 'strict',

// Runtime
Shush::setStrictness('relaxed');

// Per-route
Route::post('/kids', ...)->middleware('shush:strict');
Route::post('/forum', ...)->middleware('shush:relaxed');
```

Evasion Detection
-----------------

[](#evasion-detection)

Each language has a dedicated normaliser that catches evasion techniques:

TechniqueExampleCaught?Leet-speak symbols`sh!t`, `$h1t`, `b@stard`✅Number substitution`sh1t`, `a55`, `f4g`✅Repeated characters`shiiit`, `fuuuck`, `sshit`✅Separator tricks`s.h.i.t`, `f-u-c-k`, `s h i t`✅Mixed evasion`$h!iit`, `f.u.c.k`✅Unicode homoglyphsCyrillic а/е/о lookalikes✅Zero-width charactersHidden unicode between letters✅Diacritic strippingPolish `gówno` → `gowno`✅Diacritic substitution`ą` → `a`, `ł` → `l`✅Per-Language Normalisers
------------------------

[](#per-language-normalisers)

Each language can have its own normaliser that understands its character set and evasion patterns:

- **English** — handles standard leet-speak, homoglyphs, basic Latin diacritics
- **Polish** — handles `ą↔a`, `ć↔c`, `ę↔e`, `ł↔l`, `ń↔n`, `ó↔o`, `ś↔s`, `ź↔z`, `ż↔z` stripping

### Adding a Custom Normaliser

[](#adding-a-custom-normaliser)

```
