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

ActiveLibrary

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 1mo ago

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 32% 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

1282d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ca1ad9c82c72eed2cbefb9091dbcbdb65b85c04f51b8aa7383421704bb0288a?d=identicon)[alekseyshavrak](/maintainers/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

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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