PHPackages                             kamu/aman - 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. kamu/aman

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

kamu/aman
=========

Replace badword

v1.5.1(10mo ago)35.0k2MITPHPPHP ^8.1CI passing

Since Dec 26Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/dewanakl/aman)[ Packagist](https://packagist.org/packages/kamu/aman)[ RSS](/packages/kamu-aman/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (0)

[![aman](https://raw.githubusercontent.com/dewanakl/aman/main/img/aman.png)](https://raw.githubusercontent.com/dewanakl/aman/main/img/aman.png)

[![PHP Programming Language](https://camo.githubusercontent.com/2e8ad5c9f71cf8fcfda7f2661602965cb61a8e4703ec8f81da3bae1d642410c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6b616d752f616d616e2f7068702e7376673f636f6c6f723d627269676874677265656e)](https://php.net)[![Total Downloads](https://camo.githubusercontent.com/05f0aa5dacf1e98b987a9ee43de4d6466f1a00b7f68de5d211d2ede0e20b41ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b616d752f616d616e)](https://packagist.org/packages/kamu/aman)[![views](https://camo.githubusercontent.com/50efdb477c6869b2e0a80e5608fd42c0fcef55287b3d1861d0d2761473cfe525/68747470733a2f2f6369652e6d792e69642f616d616e3f6c6162656c3d766965777326636f6c6f723d627269676874677265656e)](https://cie.my.id)[![Repo size](https://camo.githubusercontent.com/48a576641bedf16280a7098a25968a68621342ff7a3c47a0f63e5bb09a198cdb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f646577616e616b6c2f616d616e3f636f6c6f723d627269676874677265656e)](https://shields.io)[![License](https://camo.githubusercontent.com/5277448a9008e7ba0ccbdaaebf22447082130568a783312c480804dbfe6b5f6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b616d752f616d616e3f636f6c6f723d627269676874677265656e)](https://packagist.org/packages/kamu/aman)

🤬 Simple Profanity Filter
=========================

[](#-simple-profanity-filter)

This is a simple project that filters out profane words using regex in PHP. It provides functions to check, get, mask, and remove unwanted words from a text using regex patterns that account for similar characters.

📦 Installation
--------------

[](#-installation)

1. Run the following command in your project directory:

    ```
    composer require kamu/aman
    ```
2. How to Add Blocklist or Allowlist Words

    ```
    // Add words to the blocklist
    Aman::extend(['oke', 'safe']);

    // Add words to the whitelist
    Aman::allow(['oke', 'safe']);
    ```

🛠️ Usage
--------

[](#️-usage)

1. Check for Profane Words

    ```
    use Kamu\Aman;

    $text = "This is an example with bad words.";
    $filter = Aman::factory();

    if ($filter->check($text)) {
        echo "This text contains profanity.";
    } else {
        echo "This text is clean.";
    }
    ```
2. Mask Profane Words

    ```
    $text = "This is an example with bad words.";
    $maskedText = $filter->masking($text, '*');
    echo $maskedText; // Output: "This is an example with *** ****."
    ```
3. Remove Profane Words

    ```
    $text = "This is an example with bad words.";
    $cleanText = $filter->filter($text);
    echo $cleanText; // Output: "This is an example with ."
    ```
4. Get Profane Words from Text

    ```
    $text = "This is an example with bad words.";
    $badWords = $filter->words($text);
    print_r($badWords); // Output: ['bad', 'words']
    ```

🤝 Contributing
--------------

[](#-contributing)

I'm very open to those of you who want to contribute to the Aman!

🐞 Security Vulnerabilities
--------------------------

[](#-security-vulnerabilities)

If you find any security vulnerabilities in this Aman, please email DKL via .

📜 License
---------

[](#-license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance53

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~77 days

Recently: every ~68 days

Total

8

Last Release

328d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63bebfefcad6f423ab928c052424c918ef05541fb16e91c98393e3c37c44aaca?d=identicon)[dewana](/maintainers/dewana)

---

Top Contributors

[![dewanakl](https://avatars.githubusercontent.com/u/53048107?v=4)](https://github.com/dewanakl "dewanakl (24 commits)")

---

Tags

bad-wordscontent-moderationfilterinput-sanitizationkata-kotormoderation-toolsphpprofanityprofanity-filterregexregex-filterssafe-textstring-processingtext-censorshiptext-cleaningtext-filtertext-processingtext-sanitizertext-validationword-filter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kamu-aman/health.svg)

```
[![Health](https://phpackages.com/badges/kamu-aman/health.svg)](https://phpackages.com/packages/kamu-aman)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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