PHPackages                             aashan/livewire-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. aashan/livewire-table

ActiveLibrary

aashan/livewire-table
=====================

A Package to handle LiveWire Tables

v0.1.0(3y ago)07PHP

Since Apr 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/aashan10/livewire-table)[ Packagist](https://packagist.org/packages/aashan/livewire-table)[ RSS](/packages/aashan-livewire-table/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

### Livewire Tables

[](#livewire-tables)

Livewire tables is an add-on for your laravel/livewire project that lets you beautiful data tables within a matter of minutes. It comes with Table and Column classes that handle the logic behind your data tables.

### Installation

[](#installation)

`composer require aashan/livewire-table`

### Usage

[](#usage)

After installing the package, here is a step-by-step guide on how you can use livewire table.

1. Create a class `UsersTable` inside the livewire components directory (app/Http/Livewire)
2. Open the `\App\Http\Livewire\UsersTable` class and make it as follows ```
    class UsersTable extends \LivewireTable\Components\Table {
         protected function columns() : array{
             return [
                 ...
             ];
         }

         protected function builder(): \Illuminate\Database\Query\Builder {
              return \App\Models\User::query();
         }
    }
    ```
3. Open the view where you want to show the table and add the livewire component name `@livewire('users-table')`

That's it. You should see a table in your view.

But wait?
---------

[](#but-wait)

You might be wondering why the table is empty. It's because we haven't added any columns yet. Remember the columns method that we just left empty? Now it's time to fill it up with actual columns.

```
protected function columns(): array
{
    return [
        \LivewireTable\Table\Column::make('id', 'ID'),
        \LivewireTable\Table\Column::make('name', 'Name'),
        \LivewireTable\Table\Column::make('email', 'Email'),
        \LivewireTable\Table\Column::make('created_at', 'Created At'),
    ]
}
```

Now when you re-fresh your page, you should be able to see the columns with their values.

### Making columns sortable, searchable and transforming data

[](#making-columns-sortable-searchable-and-transforming-data)

Very easy, Just use `sortable`, `searchable` and `transform` methods on the column class.

Example:

```
protected function columns(): array
{
    return [
        \LivewireTable\Table\Column::make('id', 'ID')->sortable(),
        \LivewireTable\Table\Column::make('name', 'Name')
            ->sortable()
            ->searchable()
            -onSearch(fn (Builder $builder, $value) => $builder->where('name', 'like', '%' . $value . '%' )),
        \LivewireTable\Table\Column::make('email', 'Email')
            ->sortable()
            ->filterable()
            -onFilter(fn (Builder $builder, $value) => $builder->where('email', 'like', '%' . $value . '%' )),
    ]
}
```

> **Warning**For `searchable` and `filterable` methods, they should always have `onSearch` and `onFilter` methods present within the column. If they are not present, searching and filtering won't work.

API
---

[](#api)

- \\LivewireTable\\Components\\Table::class
    - `public $perPage` - Determines the number of rows shown per page
- \\LivewireTable\\Table\\Column::class
    - Properties
        - `$key`: Usually corresponds to the actual database column name
        - `$label`: UI heading for the database column
        - `$searchable`: Determines if the column is searchable
        - `$sortable`: Determines if the column is sortable
        - `$filterable`: Determines if the column is filterable
        - `$transformClosure`: Action Class name or closure that transforms the data
        - `$searchClosure`: Action Class name or closure that handles search results
        - `$filterClosure`: Similar to searchClosure, only difference is it handles filters
    - Methods
        - `public function searchable(bool $value = true): static`: Sets the `$searchable` property
        - `public function sortable(bool $value = true): static`: Sets the `$sortable` property
        - `public function filterable(bool $value = true): static`: Sets the `$filterable` property
        - `public function transform($row): string`: Transforms the given row with the transformation closure
        - `public function onSearch(callable|string $action): static`: Sets `$searchClosure` property
        - `public function onFilter(callable|string $action): static`: Sets `$filtetrClosure` property
        - `public function onTransform(callable|string $action): static`: Sets `$transformClosure` property

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

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

Unknown

Total

1

Last Release

1133d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/167c0b2ff9f090fac299bc49edb5764743ec7d9d5c1dfccc1ea16c760aed312d?d=identicon)[aashan10](/maintainers/aashan10)

---

Top Contributors

[![aashan10](https://avatars.githubusercontent.com/u/18713900?v=4)](https://github.com/aashan10 "aashan10 (3 commits)")

### Embed Badge

![Health badge](/badges/aashan-livewire-table/health.svg)

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

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[mhmiton/laravel-modules-livewire

Using Laravel Livewire in Laravel Modules package with automatically registered livewire components for every modules.

236409.6k9](/packages/mhmiton-laravel-modules-livewire)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

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

Integrate seamless commenting functionality into your Laravel project.

40012.9k1](/packages/lakm-laravel-comments)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)

PHPackages © 2026

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