PHPackages                             mosdev-pro/sanitizer - 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. mosdev-pro/sanitizer

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

mosdev-pro/sanitizer
====================

Processing Input in a FormRequest

1.0.1(3y ago)19MITPHPPHP ^8.1

Since Nov 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mosdev-pro/sanitizer)[ Packagist](https://packagist.org/packages/mosdev-pro/sanitizer)[ Docs](https://github.com/mosdev-pro/sanitizer)[ RSS](/packages/mosdev-pro-sanitizer/feed)WikiDiscussions main Synced today

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

Processing Input in a FormRequest
=================================

[](#processing-input-in-a-formrequest)

[![Latest Version on Packagist](https://camo.githubusercontent.com/809e10e97b43f0f4d86d66caac58baa987b22563a779654bd24ea5a4c465de62/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f736465762d70726f2f73616e6974697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mosdev-pro/sanitizer)[![GitHub Tests Action Status](https://camo.githubusercontent.com/149d5a6bc84a5044dfb1e53dfe64dbb3a64e0d4fb675e3f991a5d63d20bed077/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d6f736465762d70726f2f73616e6974697a65722f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/mosdev-pro/sanitizer/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4f3bd00d1423e6702b380bdb02ad430fb9a365a3c6c6cc71b71190aabe51088e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d6f736465762d70726f2f73616e6974697a65722f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/mosdev-pro/sanitizer/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/072b86b8afde7dafb240de53a59188edd7a20e779a9e54857642681a62daff79/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f736465762d70726f2f73616e6974697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mosdev-pro/sanitizer)

Processing incoming values according to your rules. Now I have made 3 mechanisms:

- Clean up spaces
- Cleaning numbers from extraneous characters
- Format string to lower case

You can easily add your own rules!

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

[](#installation)

You can install the package via composer:

```
composer require mosdev-pro/sanitizer
```

You can publish the config file with:

```
php artisan vendor:publish --tag="sanitizer-config"
```

This is the contents of the published config file:

```
return [
    'rules' => [
        'custom' => '' // Your custom Pipeline
    ]
];
```

Usage
-----

[](#usage)

```
use Mosdev\Sanitizer\Traits\Sanitizer;

class Request extends FormRequest
{
    use Sanitizer;

    /**
     * List of fields and methods for their processing.
     *
     * @return array
     */
    public array $sanitize = [
        'user_id' => ['numeric'],
        'type'    => ['trim', 'lower'],
        'text'    => ['trim'],
    ];
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Aleksey Shavrak](https://github.com/mosdev-pro)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

1329d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2885578?v=4)[Aleksey Shavrak](/maintainers/alekseyshavrak)[@alekseyshavrak](https://github.com/alekseyshavrak)

---

Top Contributors

[![alekseyshavrak](https://avatars.githubusercontent.com/u/2885578?v=4)](https://github.com/alekseyshavrak "alekseyshavrak (18 commits)")

---

Tags

laravelsanitizermosdev-pro

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mosdev-pro-sanitizer/health.svg)

```
[![Health](https://phpackages.com/badges/mosdev-pro-sanitizer/health.svg)](https://phpackages.com/packages/mosdev-pro-sanitizer)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M99](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.3k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k38](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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