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

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

smartisan/laravel-query-filter
==============================

Filter Eloquent via query URL

3.0.0(5mo ago)092MITPHPPHP ^8.3CI passing

Since Jul 28Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/iamohdisa/laravel-query-filter)[ Packagist](https://packagist.org/packages/smartisan/laravel-query-filter)[ Docs](https://github.com/itsmohd/query-filter)[ RSS](/packages/smartisan-laravel-query-filter/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (3)Dependencies (7)Versions (5)Used By (0)

Filter Eloquent results via query URL
=====================================

[](#filter-eloquent-results-via-query-url)

[![Latest Version on Packagist](https://camo.githubusercontent.com/62bd54b03aacd96b24a3ea7a40302b3a61d6291fac0e01d11686af794c43ea2b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d6172746973616e2f6c61726176656c2d71756572792d66696c7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smartisan/laravel-query-filter)[![GitHub Tests Action Status](https://github.com/iamohd/laravel-query-filter/workflows/run-tests/badge.svg)](https://github.com/iamohd/laravel-query-filter/actions?query=workflow%3Arun-tests)[![Total Downloads](https://camo.githubusercontent.com/a0559f2b8240727da92365aefe460100b89b561b354ff1a6455c07fc65e8747f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736d6172746973616e2f6c61726176656c2d71756572792d66696c7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smartisan/laravel-query-filter)

Laravel query filter is a simple package that allows you to filter Eloquent results via URL query params.

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

[](#installation)

You can install the package via composer:

```
composer require smartisan/laravel-query-filter
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Smartisan\QueryFilter\QueryFilterServiceProvider" --tag="config"
```

Usage
-----

[](#usage)

1. Create a new filter class using the following command

```
php artisan make:filter UserFilter
```

2. Add a new filter method with your logic to the generated filter class

```
namespace App\Filters;

use Smartisan\QueryFilter\QueryFilter;

class UserFilter extends QueryFilter
{
    public function status($value)
    {
        return $this->builder->where('status', $value);
    }
}
```

3. To trigger the filter method, do the following in your controller

```
use App\Filters\UserFilter;

public function index()
{
    User::filter(UserFilter::class)->get();
}
```

the status filter method will be triggered automatically when the URL contains the following query param `?status=value`

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Mohammed Isa](https://github.com/iamohd)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance71

Regular maintenance activity

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~425 days

Total

4

Last Release

163d ago

Major Versions

1.0.0 → 2.0.02023-02-16

2.0.0 → 3.0.0.x-dev2026-01-23

PHP version history (3 changes)1.0.0PHP ^8.0

2.0.0PHP ^8.1

3.0.0.x-devPHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/5313a885082cfa519fbf84e9a2907695426f18e38bbada6b2a7afd048f666d52?d=identicon)[iamohd](/maintainers/iamohd)

---

Top Contributors

[![iamohdisa](https://avatars.githubusercontent.com/u/104384295?v=4)](https://github.com/iamohdisa "iamohdisa (14 commits)")[![iamohd](https://avatars.githubusercontent.com/u/269097980?v=4)](https://github.com/iamohd "iamohd (1 commits)")

---

Tags

query-filtersmartisan

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.8k14](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M203](/packages/laravel-ai)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)

PHPackages © 2026

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