PHPackages                             josueeek/php-filters - 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. josueeek/php-filters

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

josueeek/php-filters
====================

Provides a composable interface for data filtering with query strings

00PHP

Since Jun 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/josueeek/php-filters)[ Packagist](https://packagist.org/packages/josueeek/php-filters)[ RSS](/packages/josueeek-php-filters/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-filters
===========

[](#php-filters)

Filter with Query String
------------------------

[](#filter-with-query-string)

This URL:

```
/users?name=test&age=15

```

automatically knew to filter the DB query by responding with users that have their

- name containing `test`
- age as `15`

and order the records by age in descending order, all without you having to write boilerplate code 😱.

Setup
-----

[](#setup)

- Run `composer require josueeek/php-filters` in your terminal to pull the package in.

Usage
-----

[](#usage)

- In the Model class you wish to make filterable, use the `FilterableTrait` like:

```
