PHPackages                             greystoneweb/livewire-datatables - 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. greystoneweb/livewire-datatables

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

greystoneweb/livewire-datatables
================================

0.1.5(8mo ago)0764MITPHP

Since Jan 19Pushed 8mo agoCompare

[ Source](https://github.com/greystonewebteam/livewire-datatables)[ Packagist](https://packagist.org/packages/greystoneweb/livewire-datatables)[ RSS](/packages/greystoneweb-livewire-datatables/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (6)Dependencies (5)Versions (7)Used By (0)

### Introduction

[](#introduction)

Basic Example
-------------

[](#basic-example)

Using the make command: `php artisan make:datatable Users/UsersTable`

Will create two files: `Users/UsersTable.php` and `users/users-table-row.blade.php` in your Livewire directories.

Features
--------

[](#features)

### Sorting

[](#sorting)

To enable sorting just call the `sortable()` method on a column.

```
public function columns(): array
{
    return [
        Column::make('Name')
            ->sortable()
    ];
}
```

If the column header label differs from the database column, be sure to specify it with the second parameter in the `make()` method.

```
Column::make('Name', 'full_name')
    ->sortable()
```

If you need any custom sort logic to be applied, you can pass a callback to the `sortable()` method.

```
Column::make('Name')
    ->sortable(function ($query, $direction) {
        $query->orderBy('last_name', $direction);
    })
```

### Filters

[](#filters)

### Search

[](#search)

### Exporting Results

[](#exporting-results)

To use this feature, you'll have to install [Laravel Excel](https://laravel-excel.com/).

Example:

Inside your component class:

```
use Greystoneweb\LivewireDataTables\DataTable;
use Greystoneweb\LivewireDataTables\Traits\Exportable;

class UsersTable extends DataTable
{
    // Use the Exportable trait
    use Exportable;

    // Define a fileName method that returns the filename
    protected function fileName(): string
    {
        return 'users'.date('Y-m-d').'.csv';
    }
    ...
}
```

And then you can call the `export()` method from your view with `wire:click` and all of the results will be automatically be exported to CSV with filters/sorts applied. If the exported file doesn't look quite right, you can create a custom `Export` instance that extends `Greystoneweb\LivewireDataTables\Export` and return it in a method called `exporterInstance` on the datatable component. This is particularly useful when dealing with relationships.

Example:

Your component:

```
use Greystoneweb\LivewireDataTables\DataTable;
use Greystoneweb\LivewireDataTables\Export;
use Greystoneweb\LivewireDataTables\Traits\Exportable;

class UsersTable extends DataTable
{
    // Use the Exportable trait
    use Exportable;

    // Define a fileName method that returns the filename
    protected function fileName(): string
    {
        return 'users'.date('Y-m-d').'.csv';
    }

    public function exporterInstance(): Export
    {
        return new UsersExport($this);
    }
    ...
}
```

Your custom exporter:

```
use Greystoneweb\LivewireDataTables\Export;
use Maatwebsite\Excel\Concerns\WithMapping;

class UsersExport extends Export implements WithMapping
{
    public function headings(): array
    {
        return [
            'Name',
            'Organization',
            'Email',
        ];
    }

    public function map($user): array
    {
        return [
            $user->name,
            $user->organization->name,
            $user->email,
        ];
    }
}
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance61

Regular maintenance activity

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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.

###  Release Activity

Cadence

Every ~127 days

Recently: every ~157 days

Total

6

Last Release

246d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e3d653e598742e9446560321da43e9689f896f1056a8453acfdd98efbbef592?d=identicon)[idew@greystonetech.com](/maintainers/idew@greystonetech.com)

---

Top Contributors

[![isaacdew2](https://avatars.githubusercontent.com/u/43962295?v=4)](https://github.com/isaacdew2 "isaacdew2 (14 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/greystoneweb-livewire-datatables/health.svg)

```
[![Health](https://phpackages.com/badges/greystoneweb-livewire-datatables/health.svg)](https://phpackages.com/packages/greystoneweb-livewire-datatables)
```

###  Alternatives

[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21255.6k](/packages/ramonrietdijk-livewire-tables)[lakm/laravel-comments

Integrate seamless commenting functionality into your Laravel project.

40614.3k1](/packages/lakm-laravel-comments)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1319.7k3](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

23100.9k12](/packages/marcorieser-statamic-livewire)

PHPackages © 2026

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