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

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

adaptech/livewire-datatables
============================

Livewire DataTables components for back-end. Modular, easy to use, with tons of features.

090PHP

Since Apr 28Pushed 4y agoCompare

[ Source](https://github.com/AdaptechLLC/livewire-datatables)[ Packagist](https://packagist.org/packages/adaptech/livewire-datatables)[ RSS](/packages/adaptech-livewire-datatables/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Livewire DataTables
===================

[](#livewire-datatables)

Livewire DataTables components for back-end. Modular, easy to use, with tons of features.

Inspired by [Caleb's](https://github.com/calebporzio) [Livewire Screencasts](https://laravel-livewire.com/screencasts), dedicated to my friend [Bardh](https://github.com/bardh7).

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

[](#installation)

You can install the package via composer:

```
composer require adaptech/livewire-datatables
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Amirami\LivewireDataTables\LivewireDataTablesServiceProvider" --tag="livewire-datatables-config"
```

This is the contents of the published config file:

```
return [

    'multi_column_sorting' => false,

    'row_caching' => false,

];
```

This means that by default these two options are disabled. But you can enable them for individual components.

Usage
-----

[](#usage)

After creating your Livewire component, extend the component class with `Amirami\LivewireDataTables\DataTable`. The `DataTable` abstract class will ask you to implement `getQueryProperty` method. This is a computed property in Livewire which needs to return and instance of `Illuminate\Database\Eloquent\Builder` or `\Illuminate\Database\Eloquent\Relations\Relation`.

This is the part where you will build the base of your query, with filters.

```
namespace App\Http\Livewire;

use App\Models\Post;
use Amirami\LivewireDataTables\DataTable;
use Illuminate\Database\Eloquent\Builder;

class PostsIndex extends DataTable
{
    public function getQueryProperty(): Builder
    {
        return Post::query();
    }

    public function render()
    {
        $posts = $this->entries;

        return view('livewire.posts-index', compact('posts'));
    }
}
```

This is the most basic component without any datatable features. Although it is totally fine to use the datatable without any features, it kinda beats the purpose of this package. Now let's get onto the many features this package provides.

### Pagination

[](#pagination)

Pagination offers exactly the same features as Livewire's default one. It actually extends it. The only reason you'll have to use the pagination provided by this package is because Livewire's default one doesn't play nice with our other features.

```
namespace App\Http\Livewire;

use Amirami\LivewireDataTables\DataTable;
use Amirami\LivewireDataTables\Traits\WithPagination;

class PostsIndex extends DataTable
{
    use WithPagination;
}
```

You can configure how many result you want to see per page as well. If not defined the paginator will pull the default number from the model class.

```
namespace App\Http\Livewire;

use Amirami\LivewireDataTables\DataTable;
use Amirami\LivewireDataTables\Traits\WithPagination;

class PostsIndex extends DataTable
{
    use WithPagination;

    // As a property.
    public $perPage = 20;

    // Or as a method.
    public function getPerPage(): ?int
    {
        return 42;
    }
}
```

For everything else about pagination check out the [Livewire's official documentation](https://laravel-livewire.com/docs/2.x/pagination).

### Searching

[](#searching)

If you want to use rows searching you have to use `WithSearching` trait, bind an input to a component property and define searchable columns. Consider the rest handled. This is how easy it is:

```
namespace App\Http\Livewire;

use Amirami\LivewireDataTables\DataTable;
use Amirami\LivewireDataTables\Traits\WithSearching;

class PostsIndex extends DataTable
{
    use WithSearching;

    public $searchableColumns = [
        'title',
        'content',
    ];

    public function render()
    {
        $posts = $this->entries;

        return view('livewire.posts-index', compact('posts'));
    }
}
```

```

            Title
            Excerpt
            Author
            Status

        @foreach($posts as $post)

                {{ $post->title }}
                {{ $post->excerpt }}
                {{ $post->user->name }}
                {{ $post->status() }}

        @endforeach

```

### Sorting

[](#sorting)

### Filtering

[](#filtering)

### Row Caching

[](#row-caching)

Planned Features
----------------

[](#planned-features)

- Searching, sorting and filtering by relationship fields
- Bulk Actions
- Row Grouping
- Front-end components (will most-likely be a separate package)

Showcase
--------

[](#showcase)

Check out cool datatables built with `livewire-datatables` [here](https://github.com/amiranagram/livewire-datatables/discussions/categories/show-and-tell), and don't forget to share your own 🙌.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Amir Rami](https://github.com/amiranagram)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 76.9% 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/870cba127fff9c971764b79049969760775c78ee05f6ad4f41b879616a5e16e8?d=identicon)[AdaptechLLC](/maintainers/AdaptechLLC)

---

Top Contributors

[![amiranagram](https://avatars.githubusercontent.com/u/38536188?v=4)](https://github.com/amiranagram "amiranagram (10 commits)")[![AdaptechLLC](https://avatars.githubusercontent.com/u/30618005?v=4)](https://github.com/AdaptechLLC "AdaptechLLC (3 commits)")

### Embed Badge

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

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

###  Alternatives

[rappasoft/laravel-livewire-tables

A dynamic table component for Laravel Livewire

2.0k2.7M31](/packages/rappasoft-laravel-livewire-tables)[magestat/module-facebook-pixel

This extension allows you integrate the Facebook pixel to track your website visitors' actions.

36108.4k](/packages/magestat-module-facebook-pixel)[vaersaagod/geomate

GeoMate is a friend in need for all things geolocation. IP to geo lookup, automatic redirects (based on country, continent, language, etc), site switcher... You name it.

2367.3k](/packages/vaersaagod-geomate)[daixianceng/yii2-smser

Yii2 SMS extension

862.9k1](/packages/daixianceng-yii2-smser)[laminas/laminas-config-aggregator-parameters

PostProcessor extension for laminas/laminas-config-aggregator to allow usage of templated parameters within your configuration

1090.4k](/packages/laminas-laminas-config-aggregator-parameters)[yosimitso/workingforumbundle

A complete forum bundle

425.3k](/packages/yosimitso-workingforumbundle)

PHPackages © 2026

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