Download the PHP package givanov95/laravel-data-table without Composer
On this page you can find all versions of the php package givanov95/laravel-data-table. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-data-table
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:
| Package | Installer |
|---|---|
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
Backend (Laravel / PHP 8.4+)
The service provider is auto-discovered. Publish the config if you want to customise the request parameter keys:
This creates config/data-table.php.
Frontend (Vue 3 + Inertia)
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.
Configuration
config/data-table.php:
These keys map directly to the HTTP query parameters the frontend sends.
Backend usage
Basic example
setColumn accepts both shorthand positional arguments and a fully
constructed Column object — pick whichever reads better:
Relation columns
Translatable columns
Designed to plug into the common translations morphMany pattern
(translatable_id, translatable_type, locale, key, text):
Special column types
Eager-loading relations
Custom query hooks
Frontend usage
Component props
| Prop | Type | Description |
|---|---|---|
dataTable |
DataTableType<T> |
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
#additionalContent— content inside the toolbar (e.g. "Create" buttons)#advancedFilters— content inside the advanced-filters toolbar slot#cell(<column-key>)— custom renderer for a column; receives{ value, item }#cell(<relation.column>)— custom renderer for relation columns
Backend API reference
DataTable
__construct(Builder $builder, ?Request $request = null)setColumn(string|Column $keyOrColumn, ?string $label = null, bool $searchable = false, bool $orderable = false, bool $exactMatch = false): selfsetRelationColumn(RelationColumn $column): selfsetTranslatableColumn(TranslatableColumn $column): selfsetEnumColumn(string $key, class-string<\BackedEnum> $enumClass): selfsetPriceColumn(string $key): selfsetDateColumn(string $key, string $format, string $dateDelimiter = '.', string $timeDelimiter = ':'): selfsetRelation(string $relationString, ?array $columnsToSelect = null): selfsetOrdering(Ordering $ordering): selfsetRawOrdering(?RawOrdering $rawOrdering): selfprocess(?DataTableParams $params = null, ?callable $callbackBeforePaginate = null): selfadvancedSearch(callable $callback): selfgetData(): CollectiongetPaginator(): PaginatorgetBuilder(): BuildergetColumnByKey(string $key): ?Column
Column classes
| Class | Purpose |
|---|---|
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
License
MIT
All versions of laravel-data-table with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/pagination Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0