PHPackages                             onx/sanitize - 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. onx/sanitize

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

onx/sanitize
============

Helper that provides methods for text sanitization.

1.2.2(2y ago)015MITPHPPHP ^8.1.0 || ^8.2.0

Since Dec 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Zdezorientowany/OnxSanitize)[ Packagist](https://packagist.org/packages/onx/sanitize)[ RSS](/packages/onx-sanitize/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

Onx Sanitize is a PHP library that provides helper method for text sanitization.

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

[](#installation)

You can install the package via Composer:

```
composer require onx/sanitize
```

Usage
-----

[](#usage)

You can use Facade like this:

```
use Onx\Sanitize\Sanitize;

$text = '  Hello, world!  ';
$sanitizedText = Sanitize::text($text);

echo $sanitizedText; // Output: Hello, world!
```

Or you can also directly use the sanitize function:

```
$text = '  Hello, world!  ';
$sanitizedText = sanitize($text);

echo $sanitizedText; // Output: Hello, world!
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~0 days

Total

6

Last Release

889d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e974f2eb3f25ba615cea3382a04196ef55ffb1edc00dbf93d5a024d2d4c4cfaf?d=identicon)[watashi](/maintainers/watashi)

---

Top Contributors

[![Zdezorientowany](https://avatars.githubusercontent.com/u/49677053?v=4)](https://github.com/Zdezorientowany "Zdezorientowany (27 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/onx-sanitize/health.svg)

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

###  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)
