PHPackages                             slick/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. [Search &amp; Filtering](/categories/search)
4. /
5. slick/filter

ActiveLibrary[Search &amp; Filtering](/categories/search)

slick/filter
============

Filter utilities for Slick Framework

v1.0.5(10y ago)03.6k1MITPHP

Since Jan 17Pushed 10y ago2 watchersCompare

[ Source](https://github.com/slickframework/filter)[ Packagist](https://packagist.org/packages/slick/filter)[ Docs](https://github.com/slickframework/filter)[ RSS](/packages/slick-filter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (3)Used By (1)

Slick Filter package
====================

[](#slick-filter-package)

[![Latest Version](https://camo.githubusercontent.com/ec7e3081f19ec53fb84762cca10520d55b376f03d92c5ab9217372f3d3c8ea24/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f736c69636b6672616d65776f726b2f66696c7465722e7376673f7374796c653d666c61742d737175617265)](https://github.com/slickframework/filter/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/a08f4a719e2d0ff8384da4188f463e0907f27b99334252d116dce735bc6216cd/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736c69636b6672616d65776f726b2f66696c7465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/slickframework/filter)[![Coverage Status](https://camo.githubusercontent.com/87b3fb81889ecea796f9b52ec65d349883a55edbefbca10ae716668b5f46da4b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f736c69636b6672616d65776f726b2f66696c7465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/slickframework/filter/code-structure?branch=master)[![Quality Score](https://camo.githubusercontent.com/97b149d604fa3c5642d19bcecf78da1ab62f0ddb35625f72cfccdea7adb21a99/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f736c69636b6672616d65776f726b2f66696c7465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/slickframework/filter?branch=master)[![Total Downloads](https://camo.githubusercontent.com/88fda0441d8c122aee8d1d4e5c3215aed220cd217c1545c26fdc0ccc375eac9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c69636b2f66696c7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/slick/filter)

Slick Filter is a set of filter utilities tah can be used to filter input values, sanitize data and create filter chains to apply on a certain value.

This package is compliant with PSR-2 code standards and PSR-4 autoload standards. It also applies the [semantic version 2.0.0](http://semver.org) specification.

Install
-------

[](#install)

Via Composer

```
$ composer require slick/filter
```

Usage
-----

[](#usage)

The best way to filter your data is to use the `StaticFilter` utility class. It can create any `FilterInterface` filter and it has alias for the known filters that are bundled with the `Slick\Filter` package.

```
use Slick\Filter\StaticFilter;

echo StaticFilter::filter('number', '12 3');  // Will output 123

$text = StaticFilter::filter('text', 123);
echo is_string($text);      // will output 1 (true)
```

#### Known filters

[](#known-filters)

AliasClassDescription*text*`Slick\Filter\Text`Converts input to a string*number*`Slick\Filter\Number`Converts the input to an integer number*url*`Slick\Filter\Url`Converts/Fixes the input to a valid URL*htmlEntities*`Slick\Filter\HtmlEntities`Converts special characters to its html entity representation#### Filter chains

[](#filter-chains)

It is also possible to combine multiple filters to a single input value by using the `FilterChainInterface`.

```
use Slick\Filter\FilterChain;
use Slick\Filter\StaticFilter;

$filterChain = new FilterChain();

$filterChain
    ->add(StaticFilter::create('text'))
    ->add(StaticFilter::create('htmlEntities'));

$input = 'This is a simple text & cia!';

$output = $filterChain->filter($value);

echo $output;
```

The above code will output:

```
This is a simple text &amp; cia!
```

You can create you own filters by implementing the `FilterInterface`.

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

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

[](#contributing)

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

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Slick framework](https://github.com/slickframework)
- [All Contributors](https://github.com/slickframework/common/graphs/contributors)

License
-------

[](#license)

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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

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

Unknown

Total

1

Last Release

3775d ago

### Community

Maintainers

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

---

Top Contributors

[![silvamfilipe](https://avatars.githubusercontent.com/u/5720969?v=4)](https://github.com/silvamfilipe "silvamfilipe (9 commits)")

---

Tags

filterslick

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slick-filter/health.svg)

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

###  Alternatives

[clue/stream-filter

A simple and modern approach to stream filtering in PHP

1.7k261.7M7](/packages/clue-stream-filter)[laminas/laminas-filter

Programmatically filter and normalize data and files

9528.0M150](/packages/laminas-laminas-filter)[friendsofcake/search

CakePHP Search plugin using PRG pattern

1742.0M37](/packages/friendsofcake-search)[htmlawed/htmlawed

Official htmLawed PHP library for HTML filtering

401.1M9](/packages/htmlawed-htmlawed)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)[outl1ne/nova-detached-filters

This Laravel Nova package allows you to detach filters from the filter dropdown

64343.5k](/packages/outl1ne-nova-detached-filters)

PHPackages © 2026

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