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(6y ago)42.7k2[1 issues](https://github.com/sehrgutesoftware/eloquery/issues)[1 PRs](https://github.com/sehrgutesoftware/eloquery/pulls)MITPHPPHP &gt;=7.2

Since Sep 13Pushed 5y ago1 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 4w 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

29

—

LowBetter than 57% of packages

Maintenance15

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

2061d ago

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

v0.8.0PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5419165?v=4)[Joseph Paul](/maintainers/jsphpl)[@jsphpl](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-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.

45344.0k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[calebdw/larastan

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

15104.9k4](/packages/calebdw-larastan)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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