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

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

danilpetrenko/eloquent-query-filter
===================================

Package for simple query filtration

v1.0.1(2y ago)119proprietaryPHPPHP &gt;=8.0

Since Dec 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Petrenko-Daniil/eloquent-query-filter)[ Packagist](https://packagist.org/packages/danilpetrenko/eloquent-query-filter)[ RSS](/packages/danilpetrenko-eloquent-query-filter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

**EloquentQueryFilter**
=======================

[](#eloquentqueryfilter)

Package is developed for quick and easy managing filtering in your application.

### Usage:

[](#usage)

Go to your model and add `use HasFilter;` trait, so you can inject filtration logic anywhere.

Via laravel scopes this trait adds simple methods to inject your filters as a

1. One filter `User::useFilter(ActiveFilter::class)->first();`
2. Array of filters `User::useFilters([ActiveFilter::class, IsAdminFilter::class])->first();`
3. FiltersRepository `User::useFiltersRepository(UserFiltersRepository::class)->first();`

Each of your filters have to extend Filter class and implement run() method.
run() method should always return Builder instance and can use $model to check model's columns for example.

```
public function run(Builder $query, Model $model): Builder
{
    return $query->where('active', true);
}

```

You can also use $this-&gt;parameters field to conditionally filter you model.

### FiltersRepository

[](#filtersrepository)

You can create repository of filters which extends FiltersRepository class and implements getFilters() method.
As a return you should provide a list of filter classes.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Every ~1 days

Total

8

Last Release

882d ago

Major Versions

v0.3.1 → v1.02023-12-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cbf31528a50cb2eeb1f89849cc0ff98f35660f49d5f0ef11ca50b49014976c1?d=identicon)[danilpetrenko](/maintainers/danilpetrenko)

---

Top Contributors

[![Petrenko-Daniil](https://avatars.githubusercontent.com/u/62175101?v=4)](https://github.com/Petrenko-Daniil "Petrenko-Daniil (11 commits)")

### Embed Badge

![Health badge](/badges/danilpetrenko-eloquent-query-filter/health.svg)

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

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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