PHPackages                             el-mag/request-query - 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. el-mag/request-query

ActiveLibrary[API Development](/categories/api)

el-mag/request-query
====================

0251PHP

Since Jul 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ahmedsalah94/Laravel-Request-Query)[ Packagist](https://packagist.org/packages/el-mag/request-query)[ RSS](/packages/el-mag-request-query/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Request Query
=====================

[](#laravel-request-query)

Query Format
------------

[](#query-format)

### Sorting

[](#sorting)

```
{
    sort: FIELD,
    order: ASC|DESC
}

```

OR

```
{
    sort: {
        FIELD1: ASC|DESC,
        FIELD2: ASC|DESC,
        ...
    }
}

```

### Filtration

[](#filtration)

```
{
    filter: {
        FIELD1: VALUE1,
        FIELD2: VALUE2,
        FIELD3: {
            operator: '>',
            value: VALUE3
        }
    }
}

```

### Pagination

[](#pagination)

```
{
    limit: NUMBER,
    page: NUMBER,
}

```

- `limit` default to 10
- `page` default to 1

### Grouping

[](#grouping)

```
{
    group_by: FIELD,
    group_map: {
        1: "enabled",
        0: "disabled"
    }
}

```

- `group_map` is optional, but if provided, only mapped values will appear in the result.

Usage
-----

[](#usage)

1\. Using `RequestQuery` class

```
