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.2(3mo ago)22532.2k↓75.9%8[1 issues](https://github.com/IndexZer0/eloquent-filtering/issues)[2 PRs](https://github.com/IndexZer0/eloquent-filtering/pulls)2MITPHPPHP ^8.2CI passing

Since May 27Pushed 1w 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 3d ago

READMEChangelog (7)Dependencies (24)Versions (20)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

58

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 94.8% 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 ~93 days

Recently: every ~137 days

Total

8

Last Release

93d ago

Major Versions

1.x-dev → 2.0.02024-09-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24657691?v=4)[IndexZer0](/maintainers/IndexZer0)[@IndexZer0](https://github.com/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] (27 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (22 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.

17558.6k](/packages/lacodix-laravel-model-filter)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213421.0k2](/packages/wnx-laravel-backup-restore)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[giacomomasseron/laravel-models-generator

Generate Laravel models from an existing database

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

PHPackages © 2026

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