PHPackages                             hamba/queryget - 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. hamba/queryget

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

hamba/queryget
==============

Helper for query eloquent model from request

v0.4.0(7y ago)0431PHPPHP &gt;=7.0.0

Since Oct 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/fatkhank/laravel-queryget)[ Packagist](https://packagist.org/packages/hamba/queryget)[ RSS](/packages/hamba-queryget/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (1)Versions (15)Used By (1)

Laravel Query Get
=================

[](#laravel-query-get)

Laravel query get is helper to perform query to eloquent model.

### [Read full documentation](docs/doc.md)

[](#read-full-documentation)

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

[](#installation)

```
composer require hamba/queryget

```

Usage
-----

[](#usage)

You have these models:

```
class User extends Model{
    protected $fillable = [
        'username', 'email'
    ];

    public function roles()
    {
        return $this->belongsToMany(Role::class, 'role_users');
    }

    public $queryable = [
        'email' => 'string',//enable attribute email to be queried
        'name' => 'string:username',//enable attribute with alias
        'roles' => 'relation'//enable relation 'roles'
    ];
}
```

```
class Role extends Model
{
    protected $fillable = [
        'name', 'permissions',
    ];
    public $queryable = ['name', 'permissions'];
}
```

and you have this controller:

```
class UserController extends Controller
{
    public function index()
    {
        return qg(User::class)->apply()->get();
    }
}
```

and this route:

```
Route::get('users', 'UserController@index');
```

With QueryGet you can do these requests:
----------------------------------------

[](#with-queryget-you-can-do-these-requests)

### Select attribute or relation:

[](#select-attribute-or-relation)

- /users?props\[\]=name

```
{
    "total":3,
    "data":[
        {"id":1,"name":"User 1"},
        {"id":2,"name":"User 2"},
        {"id":3,"name":"User 3"},
    ]
}
```

- /users?props\[\]=name&amp;props\[\]=roles.name

```
{
    "total":3,
    "data":[
        {
            "id":1,
            "name":"User 1",
            "email":"user1@mail.com",
            "roles":[
                {"id":1,"name":"admin"},
                {"id":2,"name":"manager"}
            ]
        },
        {
            "id":2,
            "name":"User 2",
            "email":"user2@mail.com",
            "roles":[
                {"id":2,"name":"manager"}
            ]
        },
        {
            "id":3,
            "name":"User 3",
            "email":"user3@mail.com",
            "roles":[
                {"id":3,"name":"employee"}
            ]
        },
    ]
}
```

### Filter attribute or relation:

[](#filter-attribute-or-relation)

- /users?props=id&amp;email=user1%

```
{
    "total":1,
    "data":[{"id":1}]
}
```

### Sort attribute or relation

[](#sort-attribute-or-relation)

- /users?props\[\]=id&amp;props\[\]=name&amp;sortby=name\_desc

```
{
    "total":3,
    "data":[
        {"id":3,"name":"User 3"},
        {"id":2,"name":"User 2"},
        {"id":1,"name":"User 1"}
    ]
}
```

### Do pagination

[](#do-pagination)

- /users?props\[\]=name&amp;page=1&amp;pagesize=1

```
{
    "total":3,
    "data":[
        {"id":2,"name":"User 2"},
    ]
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Total

13

Last Release

2914d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c460effbd4156b8d64bb2439a83647ee38526d1beccbb349ce67e2c2463030a?d=identicon)[hamba](/maintainers/hamba)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/hamba-queryget/health.svg)

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

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[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)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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