PHPackages                             ngabor84/lumen-api-query-parser - 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. [API Development](/categories/api)
4. /
5. ngabor84/lumen-api-query-parser

ActiveLibrary[API Development](/categories/api)

ngabor84/lumen-api-query-parser
===============================

A query parser for REST-APIs based on laravel's lumen framework

1.4.0(6y ago)31.5k6[4 PRs](https://github.com/ngabor84/lumen-api-query-parser/pulls)MITPHPPHP ^7.3

Since May 3Pushed 4y agoCompare

[ Source](https://github.com/ngabor84/lumen-api-query-parser)[ Packagist](https://packagist.org/packages/ngabor84/lumen-api-query-parser)[ Docs](https://github.com/ngabor84/lumen-api-query-parser)[ RSS](/packages/ngabor84-lumen-api-query-parser/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)Dependencies (4)Versions (14)Used By (0)

Lumen API query parser
======================

[](#lumen-api-query-parser)

[ ![Codeship Status for ngabor84/lumen-api-query-parser](https://camo.githubusercontent.com/ed8c1c07f4ea355411813fb67a1841fee6275f550bf2af581998b83fd045540b/68747470733a2f2f6170702e636f6465736869702e636f6d2f70726f6a656374732f38666434373633302d313232662d303133352d393539662d3336313133333162386463662f7374617475733f6272616e63683d6d6173746572)](https://app.codeship.com/projects/216941)

Description
-----------

[](#description)

This is a simple request query parameter parser for REST-APIs based on Laravel's Lumen framework.

Requirements
------------

[](#requirements)

- PHP &gt;=7.1
- Lumen framework &gt;= 5.4
- Mockery &gt;= 0.9 (dev)
- PHPUnit &gt;= 6.1 (dev)
- PHP CodeSniffer &gt;= 3.0.0 RC4 (dev)

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

[](#installation)

- Add ngabor84/lumen-api-query-parser to your composer.json and make composer update, or composer require ngabor84/lumen-api-query-parser ~1.0
- Setup the service provider: in bootstrap/app.php add the following line: ```
    $app->register(LumenApiQueryParser\Provider\RequestQueryParserProvider::class);
    ```

Usage
-----

[](#usage)

```
    // app/API/V1/Models/UserController.php
    namespace App\Api\V1\Http\Controllers;

    use App\Api\V1\Models\User;
    use App\Api\V1\Transformers\UserTransformer;
    use LumenApiQueryParser\ResourceQueryParserTrait;
    use LumenApiQueryParser\BuilderParamsApplierTrait;

    class UserController extends Controller
    {
        use ResourceQueryParserTrait;
        use BuilderParamsApplierTrait;

        public function index(Request $request)
        {
            $params = $this->parseQueryParams($request);
            $query = User::query();
            $userPaginator = $this->applyParams($query, $params);

            $this->response->paginator($userPaginator, new UserTransformer, ['key' => 'users']);
        }
    }
```

Query syntax
------------

[](#query-syntax)

### Eager loading

[](#eager-loading)

Q: /users?connection\[\]=profile
R: will return the collection of the users with their profiles included

### Filtering

[](#filtering)

Q: /users?filter\[\]=name:ct:admin
R: will return the collection of the users whose names contains the admin string

**Available filter options**

OperatorDescriptionExamplectString containsname:ct:PeternctString NOT containsname:nct:PeterswString starts withusername:sw:adminewString ends withemail:ew:gmail.comeqEqualslevel:eq:3neNot equalslevel:ne:4gtGreater thanlevel:gt:2geGreater than or equallevel:ge:3ltLesser thanlevel:lt:4leLesser than or equallevel:le:3inIn arraylevel:in:1|2|3### Sorting

[](#sorting)

Q: /users?sort\[\]=name:ASC
R: will return the collection of the users sort by their names ascending

### Pagination

[](#pagination)

Q: /users?limit=10&amp;page=3
R: will return a part of the collection of the users (from the 21st to 30th)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

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 ~118 days

Recently: every ~232 days

Total

9

Last Release

2349d ago

PHP version history (3 changes)1.0.0PHP ~7.1

1.3.0PHP ~7.2

1.4.0PHP ^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b82b4c58ac85ec44874c61841493e3c6d7b46a1264c9902661b9d07eb638f292?d=identicon)[ngabor84](/maintainers/ngabor84)

---

Top Contributors

[![ngabor84](https://avatars.githubusercontent.com/u/22472700?v=4)](https://github.com/ngabor84 "ngabor84 (28 commits)")

---

Tags

apilumenquery parser

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ngabor84-lumen-api-query-parser/health.svg)

```
[![Health](https://phpackages.com/badges/ngabor84-lumen-api-query-parser/health.svg)](https://phpackages.com/packages/ngabor84-lumen-api-query-parser)
```

###  Alternatives

[spatie/laravel-fractal

An easy to use Fractal integration for Laravel applications

1.9k15.1M98](/packages/spatie-laravel-fractal)[darkaonline/swagger-lume

OpenApi or Swagger integration to Lumen

3372.3M3](/packages/darkaonline-swagger-lume)[jlcd/api-cielo30-laravel

Laravel Provider for Cielo's 3.0 API

17224.5k](/packages/jlcd-api-cielo30-laravel)

PHPackages © 2026

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