PHPackages                             askedio/laravel-validator-filter - 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. askedio/laravel-validator-filter

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

askedio/laravel-validator-filter
================================

Filter items before validating them with Laravels Validator

5.2(8y ago)3181MITPHPPHP &gt;=5.5.9

Since Aug 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Askedio/laravel-validator-filter)[ Packagist](https://packagist.org/packages/askedio/laravel-validator-filter)[ RSS](/packages/askedio-laravel-validator-filter/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

Laravel Validator Filter
========================

[](#laravel-validator-filter)

Filter items before your validate them with Laravel 5s Validator.

Values will be filtered based on the function you provide. If the parameter exists in the request it will also be replaced.

[![Build Status](https://camo.githubusercontent.com/45c231a73047fb4700ff0d361eb3ee884a1a5229c12596a99613974ccf1a92e0/68747470733a2f2f7472617669732d63692e6f72672f41736b6564696f2f6c61726176656c2d76616c696461746f722d66696c7465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Askedio/laravel-validator-filter)[![Codacy Badge](https://camo.githubusercontent.com/18f8fcb843696fc9a6e562389b75719b152e554a527db415ec0f782e8140c9ba/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6639316537333939633066663430633938386261313538376633353934643861)](https://www.codacy.com/app/gcphost/laravel-validator-filter?utm_source=github.com&utm_medium=referral&utm_content=Askedio/laravel-validator-filter&utm_campaign=Badge_Grade)[![Codacy Badge](https://camo.githubusercontent.com/e8e7cd516a032fa7c2469d4c71fa7602213f9004603232790f52fcdbfa1ec043/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f6639316537333939633066663430633938386261313538376633353934643861)](https://www.codacy.com/app/gcphost/laravel-validator-filter?utm_source=github.com&utm_medium=referral&utm_content=Askedio/laravel-validator-filter&utm_campaign=Badge_Coverage)[![StyleCI](https://camo.githubusercontent.com/95477febee8ce88c45c3db0b196c931d1b07991f57f073e0fe6dcbf7f47a4001/68747470733a2f2f7374796c6563692e696f2f7265706f732f37343533313631352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/74531615)

Installation
============

[](#installation)

```
composer require askedio/laravel-validator-filter

```

Add the following to the providers array in `config/app.php`:

```
Askedio\LaravelValidatorFilter\FilterServiceProvider::class

```

Examples
========

[](#examples)

You can use any function that is callable and accepts the value as the parameter.

```
$validator = app('validator')->make([
  'string' => 'Hello ' . PHP_EOL . ' World',
], [
  'string' => 'filter:strip_tags,nl2br',
]);

$validator->passes();

dd($validator->getData());
```

You can use a function with parameters in line. `()` = `[]` &amp; `,` = `;`.

```
$validator = app('validator')->make([
  'string' => 'Hello  World',
], [
  'string' => 'filter:strip_tags[{$value}; ""]',
]);

$validator->passes();

dd($validator->getData());
```

You can also define your own custom filter.

```
app('filter')->register('plusOne', function ($value) {
    return $value+1;
});

$validator = app('validator')->make([
  'int' => '1',
], [
  'int' => 'filter:strip_tags,plusOne',
]);

$validator->passes();

dd($validator->getData());
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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

Total

5

Last Release

2986d ago

Major Versions

1.1.1 → 5.22018-04-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1173636?v=4)[William](/maintainers/gcphost)[@gcphost](https://github.com/gcphost)

---

Top Contributors

[![gcphost](https://avatars.githubusercontent.com/u/1173636?v=4)](https://github.com/gcphost "gcphost (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/askedio-laravel-validator-filter/health.svg)

```
[![Health](https://phpackages.com/badges/askedio-laravel-validator-filter/health.svg)](https://phpackages.com/packages/askedio-laravel-validator-filter)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21313.7k3](/packages/ecotone-laravel)[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1040.9k5](/packages/carsdotcom-laravel-json-schema)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3310.1k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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