PHPackages                             rabbit-dog/hyperf-filters-env - 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. rabbit-dog/hyperf-filters-env

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

rabbit-dog/hyperf-filters-env
=============================

An Eloquent way to filter Eloquent Models

26PHP

Since Aug 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rabbit-dog/hyperf-filters-env)[ Packagist](https://packagist.org/packages/rabbit-dog/hyperf-filters-env)[ RSS](/packages/rabbit-dog-hyperf-filters-env/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

modelFilter
===========

[](#modelfilter)

习惯了laravel的[tucker-eric/eloquentfilter](https://github.com/Tucker-Eric/EloquentFilter)查询条件写法， 转到hyperf发现没有相关的包,所以这个包出现了。

如何使用
====

[](#如何使用)

```
 安装最新版

 composer require rabbit-dog/hyperf-filter-env -vvv

 创建目录
 app/ModelFilters

 在模型中使用trait

 use Rabbit\Filter\Filterable;
 class User extends Model
 {
    use Filterable;
 }

 创建filter类

 在app/ModelFilters中创建模型名+filter的文件

namespace App\ModelFilters;

use Rabbit\Filter\ModelFilter;

class ActiveFilter extends ModelFilter
{
    public function id($val){
        return $this->where('id',$val);
    }
}

```

注意
--

[](#注意)

1. 参数需要为下划线分割的名称 如 product\_id 那么ModelFilter中对应的方法就为productId
2. 有问题随时提问，目前只能实现搜索

issues请留言

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 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/4068d3022fdd8e19dc43dfe6035541efd33aa4026514223bb041f7df8221e08a?d=identicon)[rabbit-dog](/maintainers/rabbit-dog)

---

Top Contributors

[![rabbit-dog](https://avatars.githubusercontent.com/u/30332327?v=4)](https://github.com/rabbit-dog "rabbit-dog (46 commits)")

### Embed Badge

![Health badge](/badges/rabbit-dog-hyperf-filters-env/health.svg)

```
[![Health](https://phpackages.com/badges/rabbit-dog-hyperf-filters-env/health.svg)](https://phpackages.com/packages/rabbit-dog-hyperf-filters-env)
```

###  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.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M545](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

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

Reliese Components for Laravel Framework code generation.

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

PHPackages © 2026

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