PHPackages                             hackeresq/filter-models - 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. hackeresq/filter-models

ActiveLibrary

hackeresq/filter-models
=======================

Simple package to filter your Laravel models with query parameters

v0.1(1y ago)20PHPPHP ^8.2

Since Jan 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/hackeresq/filter-models)[ Packagist](https://packagist.org/packages/hackeresq/filter-models)[ RSS](/packages/hackeresq-filter-models/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Basic usage
===========

[](#basic-usage)

```
use HackerEsq\FilterModels\FilterModels;

class PortfolioController extends ApiController
{
    public function index(FilterModels $filters)
    {
        $filters->setQuery(Portfolio::query());
        $filters->setScopes(['myPortfolios']);
        $filters->setEagerRelations(['users', 'transactions', 'holdings']);
        $filters->setFilterableRelations(['holdings' => 'symbol', 'transactions' => 'symbol']);
        $filters->setSearchableColumns(['title', 'notes']);

        return $filters->paginated();
    }
}
```

Using filter classes
====================

[](#using-filter-classes)

1. Define a custom filter that extends the FilterModels class:

```
namespace App\Filters;

use HackerEsq\FilterModels\FilterModels;

class PortfolioFilter extends FilterModels
{
    public function apply(): void
    {
        $this->setModel(Portfolio::class);
        $this->setScopes(['myPortfolios']);
        $this->setEagerRelations(['users', 'transactions', 'holdings']);
        $this->setFilterableRelations(['holdings' => 'symbol', 'transactions' => 'symbol']);
        $this->setSearchableColumns(['title', 'notes']);
    }
}
```

2. Then use your custom filter like this:

```
use App\Filters\PortfolioFilters;

class PortfolioController extends ApiController
{
    public function index(PortfolioFilters $filters)
    {

        return $filters->paginated();
    }
}
```

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance74

Regular maintenance activity

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

469d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

filterlaravelmodels

### Embed Badge

![Health badge](/badges/hackeresq-filter-models/health.svg)

```
[![Health](https://phpackages.com/badges/hackeresq-filter-models/health.svg)](https://phpackages.com/packages/hackeresq-filter-models)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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