PHPackages                             indexzer0/eloquent-filtering - 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. [Database &amp; ORM](/categories/database)
4. /
5. indexzer0/eloquent-filtering

ActiveLibrary[Database &amp; ORM](/categories/database)

indexzer0/eloquent-filtering
============================

Powerful eloquent filtering

2.2.1(4mo ago)22425.9k↓36.1%7[3 PRs](https://github.com/IndexZer0/eloquent-filtering/pulls)2MITPHPPHP ^8.2CI passing

Since May 27Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/IndexZer0/eloquent-filtering)[ Packagist](https://packagist.org/packages/indexzer0/eloquent-filtering)[ Docs](https://github.com/indexzer0/eloquent-filtering)[ GitHub Sponsors](https://github.com/IndexZer0)[ RSS](/packages/indexzer0-eloquent-filtering/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (12)Versions (16)Used By (2)

Eloquent Filtering
==================

[](#eloquent-filtering)

[![Filter example](/docs/images/hero.png)](/docs/images/hero.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9fb7940018e92d8e0b5788596efbb86af0a1102ef46d61d0f221cbed5ab637c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e6465787a6572302f656c6f7175656e742d66696c746572696e672e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/indexzer0/eloquent-filtering)[![Total Downloads](https://camo.githubusercontent.com/eb54cb69c6774c1814094ce8549b13d929c2f944f97899c213d2844f5765b690/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e6465787a6572302f656c6f7175656e742d66696c746572696e672e7376673f7374796c653d666f722d7468652d626164676526636f6c6f723d303037656336)](https://packagist.org/packages/indexzer0/eloquent-filtering)[![GitHub Tests Action Status](https://camo.githubusercontent.com/62ff211893af3e4890bca7080c01724106869bcb04440714710edeb3815de80e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696e6465787a6572302f656c6f7175656e742d66696c746572696e672f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666f722d7468652d6261646765)](https://github.com/indexzer0/eloquent-filtering/actions?query=workflow%3Arun-tests+branch%3Amain)[![Codecov](https://camo.githubusercontent.com/2ee092739554b9e06c582af2cec27d2ac395704548cbf8a76d75b5a848fbb123/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f496e6465785a6572302f656c6f7175656e742d66696c746572696e673f746f6b656e3d333442334e495042524d267374796c653d666f722d7468652d6261646765266c6f676f3d636f6465636f76)](https://codecov.io/gh/IndexZer0/eloquent-filtering)

---

Easily filter eloquent models using arrays
------------------------------------------

[](#easily-filter-eloquent-models-using-arrays)

*Eloquent Filtering* **simplifies** implementing search functionality for your Eloquent models, whether simple or complex, by **eliminating** the need for custom query logic. It allows you to **easily** define and manage filters directly within your models, and **seamlessly** apply them using incoming HTTP request data to dynamically filter your models.

With this package, you can build more readable, maintainable, and scalable code, **boosting** your productivity and **speeding up** development.

Whether you’re building APIs, dashboards, or advanced search systems, *Eloquent Filtering* provides a **powerful** and **flexible** way to streamline your Eloquent queries, making it easier to manage and extend your application’s filtering capabilities.

---

[View The Docs](https://docs.eloquentfiltering.com)
===================================================

[](#view-the-docs)

---

Quick Look
----------

[](#quick-look)

```
class Product extends Model implements IsFilterable
{
    use Filterable;

    public function allowedFilters(): AllowedFilterList
    {
        return Filter::only(
            Filter::field('name', [FilterType::EQUAL]),
        );
    }
}

$products = Product::filter([
    [
        'target' => 'name',
        'type'   => '$eq',
        'value'  => 'TV'
    ]
])->get();
```

---

Requirements
------------

[](#requirements)

- PHP Version &gt;= `8.2`
- Laravel Version &gt;= `10`

---

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require indexzer0/eloquent-filtering
```

Run the `install` artisan command to publish the config:

```
php artisan eloquent-filtering:install
```

---

Testing
-------

[](#testing)

```
composer test
```

---

Docs
----

[](#docs)

```
npm i -g mintlify
cd docs
mintlify dev
```

---

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

---

Feature Ideas
-------------

[](#feature-ideas)

Please see [Feature ideas](feature-ideas.md) for potential future features.

---

Credits
-------

[](#credits)

- [IndexZer0](https://github.com/IndexZer0)
- [All Contributors](../../contributors)

---

License
-------

[](#license)

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

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance83

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 95.2% 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 ~95 days

Recently: every ~120 days

Total

7

Last Release

132d ago

Major Versions

1.x-dev → 2.0.02024-09-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1c51dc1ab33fc78c6123fd4d488863e2686de1991924d679396a3b3039c1846?d=identicon)[IndexZer0](/maintainers/IndexZer0)

---

Top Contributors

[![IndexZer0](https://avatars.githubusercontent.com/u/24657691?v=4)](https://github.com/IndexZer0 "IndexZer0 (892 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (25 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (20 commits)")

---

Tags

laravelnestedeloquentfiltersortfilteringfilterssortingRelationshipscolumnnestingIndexZer0eloquent-filteringCustom Filters

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/indexzer0-eloquent-filtering/health.svg)

```
[![Health](https://phpackages.com/badges/indexzer0-eloquent-filtering/health.svg)](https://phpackages.com/packages/indexzer0-eloquent-filtering)
```

###  Alternatives

[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17649.9k](/packages/lacodix-laravel-model-filter)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[rutorika/sortable

Adds sortable behavior and ordering to Laravel Eloquent models. Grouping and many to many supported.

299992.5k14](/packages/rutorika-sortable)[czim/laravel-filter

Filter for Laravel Eloquent queries, with support for modular filter building

8973.0k3](/packages/czim-laravel-filter)[akaunting/laravel-sortable

Sortable behavior package for Laravel

27175.6k](/packages/akaunting-laravel-sortable)[giacomomasseron/laravel-models-generator

Generate Laravel models from an existing database

484.2k](/packages/giacomomasseron-laravel-models-generator)

PHPackages © 2026

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