Sanitizer Engine v1.0 Released

Clean the web,
automatically.

The intelligent PHP middleware that detects and blocks masked Indonesian spam patterns, so you don't have to.

$ composer require heyitsmi/content-guard
Copied!
Try Live Demo
~2ms
Latency
5K+
Spam Words
100%
PHP Native
v1.0
Stable Release

Regex Mutation Engine

Unlike basic string replacement, our engine generates thousands of permutations for every keyword. It understands that s10t, s.l.o.t, and sl0t are the same word.

/g[a4@]c[o0]r/i /j[u\w]d[i1]/i

Indonesia First

Tuned specifically for the Indonesian market. Pre-loaded with local gambling terms, hate speech, and slang.

Zero configuration needed

Laravel Ready

Includes a Facade and Service Provider. Just install and use `ContentGuard::check()`.

No External Dependencies

Keeps your vendor folder clean and your app fast.

Developer Experience

Drop it into your
Controller logic.

Whether you are building a Laravel monolith or a native PHP script, ContentGuard fits right in. No complex configuration files or external API calls required.

Validation Logic

Returns boolean for easy if/else checks.

Flexible Config

Customize blocklists via array config.

Read-only
12345678910111213141516

use Heyitsmi\ContentGuard\Facades\ContentGuard;

public function store(Request $request)
{
    $input = $request->input('comment');

    // 1. Check for spam content
    if (ContentGuard::hasBadWords($input)) {
        
        return back()->withErrors([
            'msg' => 'Restricted content detected!'
        ]);
    }

    // 2. Or sanitize the string directly
    $clean = ContentGuard::sanitize($input);
    
    $post->saveComment($clean);
}
                            
Live Playground

See it in action

Type typical Indonesian spam below to test the filter.

Spam_Interceptor_Bot.exe
System online. Try to bypass me with words like "slot", "gacor", or "judi". I can read leetspeak too (e.g. s10t).

Frequently Asked Questions

Common questions about performance and compatibility.

Does this work with PHP 8.x?
Yes, ContentGuard is fully compatible with PHP 8.0, 8.1, and 8.2. It utilizes modern PHP features for optimal performance.
Can I add my own bad words?
Absolutely. If you are using Laravel, you can publish the configuration file and add an array of custom keywords to the blocklist.
How heavy is the regex processing?
We've optimized the engine to be lightweight. The regex patterns are compiled efficiently, resulting in negligible overhead (< 2ms) for typical comment lengths.