PHPackages                             romalytvynenko/eloquent-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. [Database &amp; ORM](/categories/database)
4. /
5. romalytvynenko/eloquent-table

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

romalytvynenko/eloquent-table
=============================

28431[1 issues](https://github.com/romalytvynenko/eloquent-table/issues)PHP

Since Oct 26Pushed 5y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Install
=======

[](#install)

Add folowing line to your `composer.json`:

```
"romalytvynenko/eloquent-table": "dev-master"
```

Add following lines to `config/app.php` (providers)

```
'Romalytvynenko\EloquentTable\EloquentTableServiceProvider'

```

And this part to `aliases` section

```
'EloquentTable' => 'Romalytvynenko\EloquentTable\Engine\EloquentTable'

```

Usage
=====

[](#usage)

First of all, cerate EloquentTable object.

```
$exampleTable = new EloquentTable('Example', $tableSettings);
```

Where first parameter is model name, and $tableSettings is special table settings used for current table. You could also provide some specific params, such as 'searchable' and 'preGet'. Where 'searchable' is array of columns which will be searchable (what a twist!), and 'preGet' is closure that will applied to query before all other filters (search, sort, etc.)

```
$tableSettings = [
    'columns' => [
        'id' => '#',
        'title' => 'Title',
        'message' => 'Message',
        'sent_at' => 'Sent',
    ],
    'sortable' => [
        'id',
        'sent_at'
    ],
    'searchable' => [
        'title'
    ],
    'preGet' => function($query) {
        /**
        * @var $query \Illuminate\Database\Query\Builder
        */
        return $query->where('type', 'group');
    },
];
```

And now you could render table using `show` method:

```
$exampleTable->show();
```

### Changing column output

[](#changing-column-output)

For changing columns output you can use closures for hooking output:

```
$table->columnOutput('id', function($item){
    /**
     * @var $item \Eloquent
     */
    return 'Item - ' . $item->id;
});
```

Where `id` is example of column name, and anonymous function - is the example of a function wich result will be used *instead* of original column value.

### Your own table layout

[](#your-own-table-layout)

You can easyli create your own table layout. For those purpose look at views/table.php sources, and feel free to create iyour own. You can use it passing to the `show` function your view name:

```
$exampleTable->show('admin.table');
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.7% 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/249f79b3fe54415db20a2528c356f5aa46fabe05965d9b7bce00bed51ce0567c?d=identicon)[romalytvynenko](/maintainers/romalytvynenko)

---

Top Contributors

[![romalytvynenko](https://avatars.githubusercontent.com/u/6153876?v=4)](https://github.com/romalytvynenko "romalytvynenko (11 commits)")[![Otaman](https://avatars.githubusercontent.com/u/5495919?v=4)](https://github.com/Otaman "Otaman (1 commits)")

### Embed Badge

![Health badge](/badges/romalytvynenko-eloquent-table/health.svg)

```
[![Health](https://phpackages.com/badges/romalytvynenko-eloquent-table/health.svg)](https://phpackages.com/packages/romalytvynenko-eloquent-table)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M542](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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