PHPackages                             abelaguiar/filter-laravel - 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. abelaguiar/filter-laravel

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

abelaguiar/filter-laravel
=========================

Make filters in laravel

v0.0.21(2y ago)2146[1 issues](https://github.com/abelaguiar/filter-laravel/issues)MITPHPPHP ^8.0CI failing

Since Jul 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/abelaguiar/filter-laravel)[ Packagist](https://packagist.org/packages/abelaguiar/filter-laravel)[ RSS](/packages/abelaguiar-filter-laravel/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (19)Used By (0)

Filters in laravel
==================

[](#filters-in-laravel)

[![PHP from Packagist](https://camo.githubusercontent.com/309438b2fd5c53eb2629dc85bf5840ac48e19ae9c6ea435f984d43e3379dd9bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6162656c6167756961722f66696c7465722d6c61726176656c2e737667)](https://packagist.org/packages/abelaguiar/filter-laravel) [![Packagist](https://camo.githubusercontent.com/d56c78fcf286ab37e23bf72f01cf2d381e589f0337fd632c8ad9dc8b1a07c47e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6162656c6167756961722f66696c7465722d6c61726176656c2e737667)](https://packagist.org/packages/abelaguiar/filter-laravel) [![Packagist](https://camo.githubusercontent.com/03a204f1632f90f23a932a2a49119767ba15b65399ece67404e4a1e34a2db8fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6162656c6167756961722f66696c7465722d6c61726176656c2e737667)](https://packagist.org/packages/abelaguiar/filter-laravel) [![Build Status](https://camo.githubusercontent.com/4eb9bd5ea8bcdc2b2f8070b1e2267e290aa84b264d991bc60228e6817dd28c2e/68747470733a2f2f7472617669732d63692e6f72672f6162656c6167756961722f66696c7465722d6c61726176656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/abelaguiar/filter-laravel)

The `abelaguiar/filter-laravel` package provides easy to use functions to simples filters in laravel.

#### Install Package

[](#install-package)

```
composer require abelaguiar/filter-laravel
```

Use `php artisan` to view the list of commands associated with filters.

#### Create filters:

[](#create-filters)

```
php artisan filter:model
```

#### Create field:

[](#create-field)

```
php artisan filter:field
```

When creating a filter, inside the class we have an array, where you will put the fields you want to use as filters in your model.

Example filter class with fields implemention:

```
use App\Filters\Fields\TitleField;
use AbelAguiar\Filter\AbstractFilter;

class PostClass extends AbstractFilter
{
    protected $filters = [
        'title' => TitleField::class
    ];
}
```

Example fields class:

```
class TitleField
{
    public function filter($builder, $value)
    {
        return $builder->where('title', $value);
    }
}
```

Created the filters, in the model that you want to connect filters, you will put:

```
use AbelAguiar\Filter\RequestFilter;

class Post
{
    use RequestFilter;
...
```

If you want to set up a different filter path, use the variable below within the model:

```
protected static $filter = 'App\Filters\PostFilter';
...
```

Finally, when calling your model anywhere in your application, just call the method `filter` by passing the request, thus returning all data from the buca, as in the example below:

```
Post::filter($request)->get()
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

Every ~111 days

Recently: every ~431 days

Total

17

Last Release

1059d ago

PHP version history (2 changes)v0.0.1PHP ^7.0

v0.0.21PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7860323?v=4)[Abel Aguiar](/maintainers/AbelAguiar)[@abelaguiar](https://github.com/abelaguiar)

---

Top Contributors

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

---

Tags

laravelfilter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/abelaguiar-filter-laravel/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M529](/packages/laravel-passport)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[kyslik/laravel-filterable

Using URL query strings to filter Eloquent queries.

11539.0k](/packages/kyslik-laravel-filterable)[hashemi/queryfilter

A simple &amp; dynamic package for your eloquent query in laravel. It will help you to write query logic individual for each parameter.

391.1k](/packages/hashemi-queryfilter)

PHPackages © 2026

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