PHPackages                             tohidhabiby/filters - 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. [Search &amp; Filtering](/categories/search)
4. /
5. tohidhabiby/filters

ActiveLibrary[Search &amp; Filtering](/categories/search)

tohidhabiby/filters
===================

This package helps you to create custom search on index method of controllers easily.

1.0.0(4y ago)0235MITPHP

Since Dec 5Pushed 4y ago1 watchersCompare

[ Source](https://github.com/tohidhabiby/filters)[ Packagist](https://packagist.org/packages/tohidhabiby/filters)[ RSS](/packages/tohidhabiby-filters/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Filters
=======

[](#filters)

This package helps you to create custom search on index method of controllers easily.

Installation
------------

[](#installation)

Use the package manager [composer](https://getcomposer.org) to install this package.

```
composer require tohidhabiby/filters
```

Usage
-----

[](#usage)

Each model should extend from BaseModel. Then create a filter class extended from Filters, the class should contain these parameters like this :

```
    /**
     * Registered filters to operate upon.
     *
     * @var array
     */
    protected array $filters = [
        'ids',
        ...
    ];

    /**
     * Define type of variables.
     *
     * @var array
     */
    public array $attributes = [
        'ids' => 'array',
        ...
    ];

    /**
     * @param string $email Email.
     *
     * @return Builder
     */
    protected function ids(array $ids) {
        return $this->builder->whereIn('id', $ids);
    }
```

Then in index method of controller you can do like this :

```
    /**
     * Display a listing of the resource.
     *
     * @param UserFilter $filters UserFilter.
     * @param Request    $request Request.
     *
     * @return AnonymousResourceCollection
     */
    public function index(UserFilter $filters, Request $request): AnonymousResourceCollection
    {
        return UserResource::collection(User::filter($filters));
    }
```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

1619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0521dbf90076ad7883116875e04a18ded54b3a7ac5343a01c6b4c8abc89a496e?d=identicon)[tohidhabiby](/maintainers/tohidhabiby)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tohidhabiby-filters/health.svg)

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

###  Alternatives

[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[massive/search-bundle

Massive Search Bundle

721.4M13](/packages/massive-search-bundle)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)[handcraftedinthealps/zendsearch

a general purpose text search engine written entirely in PHP 5

39921.0k35](/packages/handcraftedinthealps-zendsearch)

PHPackages © 2026

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