PHPackages                             sundrigast/laravel-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. sundrigast/laravel-filters

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

sundrigast/laravel-filters
==========================

Convenient and simple filters for your Laravel Eloquent application

10PHP

Since Apr 2Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Eloquent Filter
=======================

[](#laravel-eloquent-filter)

Easy and convenient filters for your **Laravel Eloquent** application

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

[](#installation)

Minimum **php** version to use the package: **7.1**
Require this package with composer.

```
composer require sundrigast/laravel-filters

```

Usage
-----

[](#usage)

```
public function index(UserFilter $filter)
{
    return User::filter($filter)
      ->paginate();
}
```

Configuration
-------------

[](#configuration)

### Basic configuration

[](#basic-configuration)

Create a new class and extend from `QueryFilter`

```
class UserFilter extends QueryFilter
{

}
```

Use trait for default filter method in your model:

```
class User extends Model
{
    use HasFilters;
}
```

You are ready to write filters!

The following scheme is used for writing filters: Create a method with the following name which corresponds to the field for the filter.

> In the case of using snake\_case (e.g. price\_from), the name of the method must be in camelCase (priceFromFilter).

*Example*:

```
class UserFilter extends Filter
{
    protected function name(string $value)
    {
        return $this->builder->where('name', $value);
    }

    protected function nameArrayFilter(array $value)
    {
        return $this->builder->whereIn('name', $value);
    }

    protected function ageFromFilter(string $value)
    {
        return $this->builder->where('age', '>=', $value);
    }
}
```

### Thank you

[](#thank-you)

Any pull requests and suggestions are welcome!

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

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://avatars.githubusercontent.com/u/55980509?v=4)[Sundrigast](/maintainers/Sundrigast)[@sundrigast](https://github.com/sundrigast)

---

Top Contributors

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

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/sundrigast-laravel-filters/health.svg)](https://phpackages.com/packages/sundrigast-laravel-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)
