PHPackages                             sehrgut/eloquery - 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. sehrgut/eloquery

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

sehrgut/eloquery
================

Apply query parameters (filter, sort, paginate, eager-load) to a laravel eloquent query builder

v0.9.0(5y ago)42.7k2[1 PRs](https://github.com/sehrgutesoftware/eloquery/pulls)MITPHPPHP &gt;=7.2

Since Sep 13Pushed 5y ago2 watchersCompare

[ Source](https://github.com/sehrgutesoftware/eloquery)[ Packagist](https://packagist.org/packages/sehrgut/eloquery)[ Docs](http://github.com/sehrgutesoftware/eloquery)[ RSS](/packages/sehrgut-eloquery/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (6)Versions (27)Used By (0)

eloquery
========

[](#eloquery)

[![Build Status](https://camo.githubusercontent.com/cbbe24679cc8b39849f861969340314d01664f0b103511d16074f04c84aee512/68747470733a2f2f7472617669732d63692e6f72672f7365687267757465736f6674776172652f656c6f71756572792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sehrgutesoftware/eloquery)[![Test Coverage](https://camo.githubusercontent.com/d9bb1b4e8c5fe56d6adff6b4e687970dfbf770ee5281f48c8ce4f7487faa2c63/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f32613431353634616330373530316137626436362f746573745f636f766572616765)](https://codeclimate.com/github/sehrgutesoftware/eloquery/test_coverage)[![Maintainability](https://camo.githubusercontent.com/c0aff39855f461d1c3cd5bbc0038b3e8a5c5624bfc31337f58f3e39b2000f681/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f32613431353634616330373530316137626436362f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/sehrgutesoftware/eloquery/maintainability)[![Latest Stable Version](https://camo.githubusercontent.com/106949e673caf03b46aa2b3afda368c4af0df50c2426fc7f87e7bc50fddd1aaf/68747470733a2f2f706f7365722e707567782e6f72672f736568726775742f656c6f71756572792f762f737461626c65)](https://packagist.org/packages/sehrgut/eloquery)

Table of Contents
-----------------

[](#table-of-contents)

- [Usage](#usage)
    - [Example usage directly in Controller](#example-usage-directly-in-controller)
- [API Documentation](#api-documentation)
- [Changelog](#changelog)
- [Todo](#todo)
- [Compatibility](#compatibility)
- [Testing](#testing)
- [Generate API Docs](#generate-api-docs)
- [Alternatives](#alternatives)
- [License](#license)

Usage
-----

[](#usage)

### Example usage directly in Controller

[](#example-usage-directly-in-controller)

```
use App\Models\Book;
use Illuminate\Routing\Controller;
use SehrGut\Eloquery\Facades\Eloquery;

class BooksController extends Controller
{
    /**
     * List all records of type `Book`.
     */
    public function index()
    {
        $builder = Book::query();
        Eloquery::apply($builder);

        return $builder->get();
    }
}
```

API Documentation
-----------------

[](#api-documentation)

Changelog
---------

[](#changelog)

Please refer to [CHANGELOG.md](CHANGELOG.md).

Todo
----

[](#todo)

- Refactor: Throw custom exception when parameters are invalid / insufficient
- Implement "include" grammar &amp; operation
- Refactor: Query param names should be customizable
- Document query params syntax/usage

Compatibility
-------------

[](#compatibility)

Tested with PHP 7.2, 7.3 and 7.4

Testing
-------

[](#testing)

```
composer install
composer test
```

Generate API Docs
-----------------

[](#generate-api-docs)

```
composer docs
```

Alternatives
------------

[](#alternatives)

- [esbenp/bruno](https://github.com/esbenp/bruno)
- [spatie/laravel-query-builder](https://github.com/spatie/laravel-query-builder)

License
-------

[](#license)

This software is licensed under the [MIT License](https://opensource.org/licenses/MIT). See [LICENSE.txt](LICENSE.txt) for details.

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.9% 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 ~31 days

Recently: every ~105 days

Total

26

Last Release

2011d ago

PHP version history (2 changes)v0.1.1PHP &gt;=7.0

v0.8.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/083c5f876eae098dee938b3685455816f8d411a7be550d0f58f663e02a0eea7f?d=identicon)[jsphpl](/maintainers/jsphpl)

---

Top Contributors

[![jsphpl](https://avatars.githubusercontent.com/u/5419165?v=4)](https://github.com/jsphpl "jsphpl (87 commits)")[![jwahdatehagh](https://avatars.githubusercontent.com/u/2725836?v=4)](https://github.com/jwahdatehagh "jwahdatehagh (1 commits)")

---

Tags

eloquentlaravellaravel-packagequery-builder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sehrgut-eloquery/health.svg)

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

###  Alternatives

[clickbar/laravel-magellan

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

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[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)[aglipanci/laravel-eloquent-case

Adds CASE statement support to Laravel Query Builder.

115157.2k](/packages/aglipanci-laravel-eloquent-case)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)

PHPackages © 2026

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