PHPackages                             matthewerskine/request-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. matthewerskine/request-filters

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

matthewerskine/request-filters
==============================

Laravel request filtering helpers.

1.0.0(8y ago)08851MITPHP

Since May 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/matthewerskine/request-filters)[ Packagist](https://packagist.org/packages/matthewerskine/request-filters)[ RSS](/packages/matthewerskine-request-filters/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

Request Filters
===============

[](#request-filters)

This package is used to allow quick and dynamic filtering of eloquent based models using a simple request argument. Perfect for backend APIs!

Configuration
-------------

[](#configuration)

To begin using this package in Laravel, you should firstly create a macro for a `request()->filter()` method as shown below:

```
use MatthewErskine\RequestFilters\RequestFilters;

request()->macro('filters', function() {
    return RequestFilters::getFilterCollection(
        // Use the 'filters' query param.
        request()->query('filters')
    );
});
```

*Note: For Lumen applications, you'll need a helper file to define the `request()` method as this is not available by default.*

Now within any of your repositories, you can begin filtering the results from that model based on whatever strategy and parameter information was provided within the `filters` query parameter:

```
public function getFood()
{
    return request()->filters()->apply(
        DB::table('food')
    );
}
```

Now, we can provide a base\_64 encoded string containing a JSON strategy for how we wish to filter our food. For example:

```
[
    {
        "strategy": "where",
        "parameters": [
            "calories",
            ">",
            100
        ]
    },
    {
        "strategy": "whereIn",
        "parameters": [
            "food_type",
            "('fried', 'baked')"
        ]
    }
]
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

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

2933d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c28f17f4e6768f9ebcf15a24eae8faa9e4cf121b9223bdddadb10c0fb245db57?d=identicon)[matthew.erskine](/maintainers/matthew.erskine)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matthewerskine-request-filters/health.svg)

```
[![Health](https://phpackages.com/badges/matthewerskine-request-filters/health.svg)](https://phpackages.com/packages/matthewerskine-request-filters)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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