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

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

tkaratug/livewire-smart-table
=============================

An advanced datatable component for Laravel Livewire

v1.5.0(3y ago)922.1k↓50%14MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Jun 14Pushed 3y ago5 watchersCompare

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

READMEChangelog (7)Dependencies (4)Versions (10)Used By (0)

Livewire Smart Table
====================

[](#livewire-smart-table)

An advanced, dynamic datatable component with pagination, sorting, and searching including json data.

[![Livewire Smart Table Demo](demo/livewire-smart-table.gif)](demo/livewire-smart-table.gif)

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

[](#installation)

You can install the package via composer:

```
composer require tkaratug/livewire-smart-table
```

Requirements
------------

[](#requirements)

This package uses livewire/livewire () under the hood.

It also uses Tailwind () for base styling.

Please make sure you include both of these dependencies before using this component.

Usage
-----

[](#usage)

In order to use this component, you must create a new Livewire component that extends from `LivewireSmartTable`

You can use `make:livewire` to create a new component. For example.

```
php artisan make:livewire UserList

```

In the `UserList` class, instead of extending from the base Livewire Component class, extend from `LivewireSmartTable` class. Also, remove the render method. You'll have a class similar to this snippet.

In this class, you must define columns that you want to show in a table.

```
class UserList extends LivewireSmartTable
{
    $columns = [
        'id' => [
            'type' => 'string', // column type
            'name' => 'Id', // column header
            'class' => 'text-danger', // column class
        ],
        'name' => [
            'type' => 'string',
            'name' => 'Name',
        ],
        'email' => [
            'type' => 'string',
            'name' => 'E-Mail',
        ],
    ];
}
```

Keys of columns array must be the same as column names in database table or key of a json object.

To render the component in a view, just use the Livewire tag or include syntax.

```

```

`$query` must be instance of an **Eloquent Collection**.

For example, create a `UserController` class, select users to show in a table and pass them to a view file.

```
class UserController extends Controller
{
    public function index()
    {
        $users = App\User::where('is_active', '=', true)->get();

        return view('users', ['users' => $users]);
    }
}
```

Then in `users.blade.php` use Livewire tag and give users to `query` attribute.

```

```

Column Properties
-----------------

[](#column-properties)

### `string`

[](#string)

It is used for showing data as string in HTML table.

### `link`

[](#link)

It is used for showing data as link in HTML table.

In addition to type, you must define a `url` to redirect when clicked.

```
$columns = [
    'profile' => [
        'type' => 'link',
        'url' => 'http://example.com/users/{id}/profile',
        'target' => '_blank'
    ],
];
```

It is also possible to give parameters to the URL. All you need to do is give the column name containing the data you want to pass to the url in curly braces.

Let's say you have a database table contains blog posts and each post has a slug. To show post titles in html table as a link, you need to define column as follows:

```
'title' => [
    'type' => 'link',
    'url' => 'http://example.com/posts/{slug}',
];
```

The component is smart enough to find the `slug` field of current record and give it to the url.

### `json`

[](#json)

It is used for showing data from json columns. If you have a json column in your database table, you can show values from it in html table.

Let's say you have a json column named `contact` in your database table and contains address details in it.

`{"address":{"country":"Turkey","city":"Istanbul","state":"Besiktas"}}`

To show just the city in html table, you need to define column as follows:

```
'city' => [
    'type' => 'json',
    'name' => 'City', // Text for column header
    'from' => 'contact', // field that contains json data in a db table
    'value' => 'address.city' // nested json value
];
```

It will find the json data from `contact` column, and take city value inside address key then show it on the table.

### `actions`

[](#actions)

It is used for showing action links for each row in html table.

You need to give `element` and `url` keys for the html element of the link and url to redirect.

```
'actions' => [
    'type' => 'actions',
    'name' => 'Actions', // Text for column header
    'actions' => [
        [
            'element' => 'View',
            'url' => 'http://example.com/users/{id}/profile'
        ],
        [
            'element' => 'Edit',
            'url' => 'http://example.com/users/{id}/edit'
        ],
    ]
];
```

Publishing Views
----------------

[](#publishing-views)

You can also publish the view files to customize them.

All you need to do is running the following command. Then the views will be copied into `/resources/views/vendor/livewire-smart-table` directory.

```
php artisan vendor:publish --tag=livewire-smart-table-views
```

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Turan Karatuğ](https://github.com/tkaratug)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity73

Established project with proven stability

 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 ~163 days

Recently: every ~241 days

Total

7

Last Release

1175d ago

PHP version history (3 changes)v1.0.0PHP ^7.1

v1.4.0PHP ^7.4|^8.0|^8.1

v1.5.0PHP ^7.4|^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/50dc98a0c75a1aaba61d52bb073e1b0cbdb17f4d5ed4bd1c694c71784b088e16?d=identicon)[tkaratug](/maintainers/tkaratug)

---

Top Contributors

[![tkaratug](https://avatars.githubusercontent.com/u/4394344?v=4)](https://github.com/tkaratug "tkaratug (9 commits)")

---

Tags

tkaratuglivewire-smart-table

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[livewire/flux

The official UI component library for Livewire.

9385.0M85](/packages/livewire-flux)[jantinnerezo/livewire-alert

This package provides a simple alert utilities for your livewire components.

8041.2M20](/packages/jantinnerezo-livewire-alert)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[revolution/self-ordering

Self Ordering System

2112.7k](/packages/revolution-self-ordering)[joelwmale/livewire-quill

Easily add QuillJS with image support to any Laravel Livewire component.

1314.0k](/packages/joelwmale-livewire-quill)

PHPackages © 2026

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