PHPackages                             imer/laravel-query-table - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. imer/laravel-query-table

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

imer/laravel-query-table
========================

Laravel plugin for displaying query results as a table with built-in filtering/sorting/pagination

02.0kPHP

Since Mar 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/imerr/laravel-query-table)[ Packagist](https://packagist.org/packages/imer/laravel-query-table)[ RSS](/packages/imer-laravel-query-table/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

QueryTable
==========

[](#querytable)

A laravel plugin for displaying query results as a table with built-in filtering/sorting/pagination. Views use bootstrap and font-awesome, but can be published and modified via `php artisan vendor:publish --provider="imer\QueryTable\QueryTableProvider"` command While this package is still in early stages the api might still change for better usability

Example:

```
use imer\QueryTable;
use imer\QueryTable\HtmlString;

// ...

$countries = ["de" => "Germany", "gb" => "United Kingdom", "us" => "United States"];
$customers = (new QueryTable($request, Customer::query()))
    ->addField(
        (new QueryTable\Field("customer_number"))
            ->sortable()
            ->filter(new QueryTable\TextFilter())
            ->formatAsLink(function (Customer $r) {
                return route("customer.show", ["id" => $r->id]);
            })
    )
    ->addField(
        (new QueryTable\Field("company"))
            ->sortable()
            ->filter(new QueryTable\TextFilter())
    )
    ->addField((new QueryTable\Field("name"))->sortable()->filter(new QueryTable\TextFilter()))
    ->addField((new QueryTable\Field("email"))->sortable()->filter(new QueryTable\TextFilter()))
    ->addField(
    // Filter by yes/no
        (new QueryTable\Field("tax_exempt"))
            ->sortable()
            ->filter(new QueryTable\BoolFilter())
            ->formatter(function ($v) {
                return $v ? trans("misc.yes") : trans("misc.no");
            })
    )
    ->addField(
    // Country field with a dropdown filter
        (new QueryTable\Field("country"))
            ->sortable()
            ->filter(new QueryTable\DropdownFilter($countries))
            ->formatter(function ($v) use ($countries) {
                return $countries[$v] ?? "n/a";
            })
    )
    ->addField((new QueryTable\ViewField("customer._table_actions"))
        ->nameText(new HtmlString('')));

// pass $customers to your view and simply output the table:
// {!! $customers !!}
```

Turns into: [![preview of rendered table](https://private-user-images.githubusercontent.com/1426904/249666022-4ae52043-d2bf-4882-a995-ce84af3c72e0.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwMzM2MzEsIm5iZiI6MTc3NTAzMzMzMSwicGF0aCI6Ii8xNDI2OTA0LzI0OTY2NjAyMi00YWU1MjA0My1kMmJmLTQ4ODItYTk5NS1jZTg0YWYzYzcyZTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MDFUMDg0ODUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGJmODA0MjE0ZTA1ZTlkM2I0MmM2YWIzNmYxZTZjN2Y0YTkzYWNlYTczZjA5ZDFlOGQ4ZjA3NjE4ZjViM2U2YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.SXRQyUhQG2wqWWXBg4e7zoAYv8OcP5GIG1bokxby010)](https://private-user-images.githubusercontent.com/1426904/249666022-4ae52043-d2bf-4882-a995-ce84af3c72e0.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwMzM2MzEsIm5iZiI6MTc3NTAzMzMzMSwicGF0aCI6Ii8xNDI2OTA0LzI0OTY2NjAyMi00YWU1MjA0My1kMmJmLTQ4ODItYTk5NS1jZTg0YWYzYzcyZTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MDFUMDg0ODUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGJmODA0MjE0ZTA1ZTlkM2I0MmM2YWIzNmYxZTZjN2Y0YTkzYWNlYTczZjA5ZDFlOGQ4ZjA3NjE4ZjViM2U2YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.SXRQyUhQG2wqWWXBg4e7zoAYv8OcP5GIG1bokxby010)

Filter demo:

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance58

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/07b3acc8f288c59458e6abbb6f65d1a42f3db7c3f32169db0bbfac4ed7842ba2?d=identicon)[imer](/maintainers/imer)

---

Top Contributors

[![imerr](https://avatars.githubusercontent.com/u/1426904?v=4)](https://github.com/imerr "imerr (10 commits)")

### Embed Badge

![Health badge](/badges/imer-laravel-query-table/health.svg)

```
[![Health](https://phpackages.com/badges/imer-laravel-query-table/health.svg)](https://phpackages.com/packages/imer-laravel-query-table)
```

PHPackages © 2026

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