1. Go to this page and download the library: Download imliamxo/shush library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
imliamxo / shush example snippets
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'],
// ]
use ImLiaMxo\Shush\Rules\NoProfanity;
$request->validate([
'comment' => ['
Shush::setStrictness('strict');
Shush::setMode('block');
Shush::setMask('#');
Shush::setNormalise(false);
Shush::addWords(['customword']); // moderate, first language
Shush::addWords(['slur'], 'severe', 'en'); // specific tier + language
Shush::allow(['damn']); // whitelist
Shush::disallow(['cocktail']); // un-whitelist
Shush::registerNormaliser('de', GermanNormaliser::class); // custom normaliser
Shush::getWords(); // all dictionaries
Shush::getWords('severe', 'en'); // English severe words
Shush::getActiveWords(); // words at current strictness
Shush::getWhitelist(); // full whitelist
Shush::getStrictness(); // 'relaxed' | 'normal' | 'strict'
Shush::getLanguages(); // ['en', 'pl']