PHPackages                             dinkbit/filterable - 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. dinkbit/filterable

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

dinkbit/filterable
==================

Make your eloquent models filterable with ease.

634PHP

Since Feb 28Pushed 11y ago8 watchersCompare

[ Source](https://github.com/dinkbit/filterable)[ Packagist](https://packagist.org/packages/dinkbit/filterable)[ RSS](/packages/dinkbit-filterable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Filterable Eloquent Models
==========================

[](#filterable-eloquent-models)

[![Build Status](https://camo.githubusercontent.com/9eeb2d4a911a062a75e0ce7296db9e56408e6b8adbe065b220e4133431494f0a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64696e6b6269742f66696c74657261626c652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dinkbit/filterable)[![StyleCI](https://camo.githubusercontent.com/fc2944afdff9681ee2d761d451bf665d3c797c9c54ac25d6ea114e22919e3241/68747470733a2f2f7374796c6563692e696f2f7265706f732f33303931333230372f736869656c64)](https://styleci.io/repos/30913207)

### Setup

[](#setup)

```
use Dinkbit\Filterable\FiterableTrait;

class Post extends Eloquent
{
    use FilterableTrait;

    /**
     * Enabled filterable scopes.
     *
     * @var string
     */
    protected $filterable = ['price', 'quantity'];

    public function scopePrice($query, $param)
    {
        return $query->where('price', $param);
    }

    public function scopeQuantity($query, $param)
    {
        return $query->where('item_quantity', $param);
    }
}
```

### Usage

[](#usage)

```
$posts = Post::filter(['quantity' => 10, 'price' => '100'])->get();
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/2cb5de3e995da2113eecbf66d639bcaa5c288f79945a2328f869be82f2233fe7?d=identicon)[dinkbit](/maintainers/dinkbit)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/dinkbit-filterable/health.svg)

```
[![Health](https://phpackages.com/badges/dinkbit-filterable/health.svg)](https://phpackages.com/packages/dinkbit-filterable)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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