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(3mo ago)092MITPHPPHP ^8.3CI passing

Since Jul 28Pushed 3mo 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 1mo 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

43

—

FairBetter than 91% of packages

Maintenance79

Regular maintenance activity

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

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

109d 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

[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[jerome/filterable

Streamline dynamic Eloquent query filtering with seamless API request integration and advanced caching strategies.

19226.1k](/packages/jerome-filterable)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[mehdi-fathi/eloquent-filter

Eloquent Filter adds custom filters automatically to your Eloquent Models in Laravel.It's easy to use and fully dynamic, just with sending the Query Strings to it.

450191.6k1](/packages/mehdi-fathi-eloquent-filter)

PHPackages © 2026

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