PHPackages                             givanov95/laravel-data-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. givanov95/laravel-data-table

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

givanov95/laravel-data-table
============================

A server-side DataTable builder for Laravel with a matching Vue 3 + Inertia frontend.

v2.0.0(1mo ago)016MITPHPPHP ^8.4CI passing

Since May 18Pushed 1mo agoCompare

[ Source](https://github.com/givanov95/laravel-data-table)[ Packagist](https://packagist.org/packages/givanov95/laravel-data-table)[ RSS](/packages/givanov95-laravel-data-table/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (16)Versions (6)Used By (0)

Laravel DataTable
=================

[](#laravel-datatable)

A server-side **DataTable** builder for Laravel that ships with a matching **Vue 3 + Inertia** frontend. Backend and frontend live in the same repository and are published as two separate packages:

PackageInstaller`givanov95/laravel-data-table``composer require givanov95/laravel-data-table``@givanov95/vue-data-table``npm install @givanov95/vue-data-table`The two are designed to talk to each other through a single JSON payload, so you write your table definition once in PHP and the Vue component renders it.

---

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

[](#installation)

### Backend (Laravel / PHP 8.4+)

[](#backend-laravel--php-84)

```
composer require givanov95/laravel-data-table
```

The service provider is auto-discovered. Publish the config if you want to customise the request parameter keys:

```
php artisan vendor:publish --tag=data-table-config
```

This creates `config/data-table.php`.

### Frontend (Vue 3 + Inertia)

[](#frontend-vue-3--inertia)

```
npm install @givanov95/vue-data-table
```

Register the plugin once (e.g. in `app.ts` / `app.js`). Both options are optional — without them the components fall back to identity translations and a global `route()` helper if one exists.

```
import { createApp } from "vue";
import { DataTablePlugin } from "@givanov95/vue-data-table";

createApp(App)
    .use(DataTablePlugin, {
        // Hook up your i18n helper:
        translator: (key) => window.__(key),
        // Hook up ziggy or whatever produces URLs:
        route: window.route,
        // Optional: debounce delay for filter/search reloads (ms)
        reloadDebounceMs: 1200,
    })
    .mount("#app");
```

---

Configuration
-------------

[](#configuration)

`config/data-table.php`:

```
return [
    'translatable_table'  => 'translations',
    'translatable_column' => 'key',

    'global_filter' => 'filter.global',
    'per_page'      => 'perPage',
    'trashed'       => 'filter.trashed',
    'restore_id'    => 'restore_id',
    'ordering'      => 'ordering',

    'default_per_page' => 15,
];
```

These keys map directly to the HTTP query parameters the frontend sends.

---

Backend usage
-------------

[](#backend-usage)

### Basic example

[](#basic-example)

```
use Givanov95\DataTable\DataTable;
use App\Models\User;

public function index()
{
    $table = (new DataTable(User::query()))
        ->setColumn('id', '#', searchable: true, orderable: true)
        ->setColumn('name', __('Name'), searchable: true, orderable: true)
        ->setColumn('email', __('Email'), searchable: true, orderable: true)
        ->setColumn('action', __('Action'))
        ->process();

    return Inertia::render('Users/Index', [
        'dataTable' => fn () => $table,
    ]);
}
```

`setColumn` accepts both shorthand positional arguments **and** a fully constructed `Column` object — pick whichever reads better:

```
use Givanov95\DataTable\Columns\Column;

$table
    ->setColumn(new Column('id', '#', searchable: true, orderable: true))
    ->setColumn('action', __('Action'));
```

### Relation columns

[](#relation-columns)

```
use Givanov95\DataTable\Columns\RelationColumn;

$table->setRelationColumn(
    new RelationColumn('user.name', __('User'), searchable: true, orderable: true)
);
```

### Translatable columns

[](#translatable-columns)

Designed to plug into the common `translations` morphMany pattern (`translatable_id`, `translatable_type`, `locale`, `key`, `text`):

```
use Givanov95\DataTable\Columns\TranslatableColumn;

$table->setTranslatableColumn(
    new TranslatableColumn(
        locale: app()->getLocale(),
        translationKey: 'title',
        label: __('Title'),
        searchable: true,
        orderable: true,
    )
);
```

### Special column types

[](#special-column-types)

```
// Enum filtering by case name
$table->setEnumColumn('status', App\Enums\OrderStatus::class);

// Numeric-only filtering (currency / numeric input)
$table->setPriceColumn('price');

// Date filtering with timezone-aware parsing
$table->setDateColumn('created_at', 'd.m.Y H:i:s');
```

### Eager-loading relations

[](#eager-loading-relations)

```
$table->setRelation('translations');
$table->setRelation('user', ['id', 'name']);
```

### Custom query hooks

[](#custom-query-hooks)

```
$table->process(null, function ($query) {
    $query->where('owner_id', auth()->id());
});

// Or for free-form mutations:
$table->advancedSearch(fn ($q) => $q->whereJsonContains('tags', 'featured'));
```

---

Frontend usage
--------------

[](#frontend-usage)

```

import { DataTable } from "@givanov95/vue-data-table";
import type { DataTableType } from "@givanov95/vue-data-table";

defineProps();

            Edit

```

### Component props

[](#component-props)

PropTypeDescription`dataTable``DataTableType`The payload returned by `(new DataTable(...))->process()``propName``string` (default `dataTable`)Inertia prop key for partial reloads`globalSearch``boolean`Show the global search input`showTrashed``boolean`Show the "trashed" toggle`advancedFilters``boolean`Reserve space for the advanced-filters slot`selectedRowIndexes``(string | number)[]`Highlight matching rows`selectedRowColumn``string`Column to match against `selectedRowIndexes``rowClickLink``string`URL template (use `?id` placeholder) for row clicks`perPageOptions``number[]`Render a per-page dropdown### Slots

[](#slots)

- `#additionalContent` — content inside the toolbar (e.g. "Create" buttons)
- `#advancedFilters` — content inside the advanced-filters toolbar slot
- `#cell()` — custom renderer for a column; receives `{ value, item }`
- `#cell()` — custom renderer for relation columns

---

Backend API reference
---------------------

[](#backend-api-reference)

### `DataTable`

[](#datatable)

- `__construct(Builder $builder, ?Request $request = null)`
- `setColumn(string|Column $keyOrColumn, ?string $label = null, bool $searchable = false, bool $orderable = false, bool $exactMatch = false): self`
- `setRelationColumn(RelationColumn $column): self`
- `setTranslatableColumn(TranslatableColumn $column): self`
- `setEnumColumn(string $key, class-string $enumClass): self`
- `setPriceColumn(string $key): self`
- `setDateColumn(string $key, string $format, string $dateDelimiter = '.', string $timeDelimiter = ':'): self`
- `setRelation(string $relationString, ?array $columnsToSelect = null): self`
- `setOrdering(Ordering $ordering): self`
- `setRawOrdering(?RawOrdering $rawOrdering): self`
- `process(?DataTableParams $params = null, ?callable $callbackBeforePaginate = null): self`
- `advancedSearch(callable $callback): self`
- `getData(): Collection`
- `getPaginator(): Paginator`
- `getBuilder(): Builder`
- `getColumnByKey(string $key): ?Column`

### Column classes

[](#column-classes)

ClassPurpose`Column`Plain column (key, label, searchable, orderable…)`RelationColumn`Dot-notated relation column (`'user.name'`)`TranslatableColumn`Pulls value from the configured translations table`EnumColumn`Internal — registered via `setEnumColumn``PriceColumn`Internal — registered via `setPriceColumn``DateColumn`Internal — registered via `setDateColumn`---

Repository layout
-----------------

[](#repository-layout)

```
laravel-data-table/
├── composer.json              # PHP package manifest
├── package.json               # NPM package manifest
├── tsconfig.json
├── src/                       # PHP source
│   ├── DataTable.php
│   ├── DataTableConfig.php
│   ├── DataTableParams.php
│   ├── DataTableServiceProvider.php
│   ├── ColumnFilter.php
│   ├── Columns/
│   ├── Exceptions/
│   ├── Support/
│   └── config/data-table.php
└── resources/
    └── js/                    # Vue / TypeScript source
        ├── index.ts
        ├── install.ts
        ├── config.ts
        ├── Table.vue
        ├── components/
        ├── icons/
        ├── types/
        └── utils/

```

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance92

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

5

Last Release

38d ago

Major Versions

v0.2.0 → v1.0.02026-05-18

v1.1.0 → v2.0.02026-05-26

PHP version history (2 changes)v0.2.0PHP ^8.3

v2.0.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/63155374?v=4)[givanov95](/maintainers/givanov95)[@givanov95](https://github.com/givanov95)

---

Top Contributors

[![givanov95](https://avatars.githubusercontent.com/u/63155374?v=4)](https://github.com/givanov95 "givanov95 (13 commits)")

---

Tags

laravelinertiadatatabledata tablevue

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/givanov95-laravel-data-table/health.svg)

```
[![Health](https://phpackages.com/badges/givanov95-laravel-data-table/health.svg)](https://phpackages.com/packages/givanov95-laravel-data-table)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k55.0M619](/packages/laravel-scout)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)

PHPackages © 2026

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