PHPackages                             laravel-enso/datatable - 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. laravel-enso/datatable

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

laravel-enso/datatable
======================

DataTable package for the DataTables.net library with server-side processing and a VueJS component

2.0.6(8y ago)81.2k3MITPHPPHP &gt;=7.1.0

Since Mar 19Pushed 7y ago2 watchersCompare

[ Source](https://github.com/laravel-enso/DataTable)[ Packagist](https://packagist.org/packages/laravel-enso/datatable)[ Docs](https://github.com/laravel-enso/DataTable)[ RSS](/packages/laravel-enso-datatable/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (72)Used By (0)

Data Table
==========

[](#data-table)

[![Codacy Badge](https://camo.githubusercontent.com/f1a9cdaed3ff17720a731c08f73c3f9d708595091cd38143033b59702f4b01a3/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6565363764653435643166313464626439386562373263386366393732393032)](https://www.codacy.com/app/laravel-enso/DataTable?utm_source=github.com&utm_medium=referral&utm_content=laravel-enso/DataTable&utm_campaign=Badge_Grade)[![StyleCI](https://camo.githubusercontent.com/f6e7190d051df7fb7ef2a683d804b5ab90bb9e62f2afad0bfe9710c052dd0cfe/68747470733a2f2f7374796c6563692e696f2f7265706f732f38353439353830322f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/85495802)[![License](https://camo.githubusercontent.com/6949c99afff29c880a3c7a26f6f5e9798220091f5c3f679ccbe407dbf5299127/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f646174617461626c652f6c6963656e7365)](https://https://packagist.org/packages/laravel-enso/datatable)[![Total Downloads](https://camo.githubusercontent.com/0a8368b64f59ada4ee7ae5464da3f13aab4389387bfaca36c3e787749114d143/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f646174617461626c652f646f776e6c6f616473)](https://packagist.org/packages/laravel-enso/datatable)[![Latest Stable Version](https://camo.githubusercontent.com/44c0fdc24e40db019855ff3c60b43bc45021a4767f23086d0e378eebeee3e46b/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f646174617461626c652f76657273696f6e)](https://packagist.org/packages/laravel-enso/datatable)

DataTable package for the [DataTables.net](https://datatables.net/) library with server-side processing and a VueJS component.

[![Watch the demo](https://camo.githubusercontent.com/1a620142ca7e7ff834060655dcacb9d39cf653a1e014c1f754af0d617701e770/68747470733a2f2f6c61726176656c2d656e736f2e6769746875622e696f2f646174617461626c652f73637265656e73686f74732f62756c6d615f3030315f7468756d622e706e67)](https://laravel-enso.github.io/datatable/videos/bulma_demo_01.webm)click on the photo to view a short demo in compatible browsers

### Details

[](#details)

Supports:

- server side data loading, with multi-argument
- searching in all the columns of the table (you can also choose to exclude columns)
- customizable column visibility
- beautiful tag rendering for boolean flag columns
- striped rows for a pleasant aspect
- supports custom rendering of data in columns
- state save for each table, for certain options and preferences, with the option to reset everything to default
- reordering of columns
- sorting on any column (you can also choose to exclude some columns within the configuration)
- user configurable pagination
- reloading of data on demand
- automatic display of show/edit/delete buttons based on available permissions
- server-side excel exporting of the table data, using current search filtering, up to a configurable limit
- permits overriding of the appends attribute for the main query model
- sublime snippet for table template and more

### Installation

[](#installation)

The component is already included in the Enso install and should not require any additional installation steps.

### Use

[](#use)

1. Optionally, you may publish the example table structure class

    ```
    php artisan vendor:publish --tag=datatable-class

    ```
2. In your controller add the `DataTable` trait. This includes two helper methods that will manage the builder:

    - initTable
    - getTableData
3. In the controller you must define a method for the query builder, such as:

    ```
    public function getTableQuery()
    {
        return MyModel::select(\DB::raw('id as DT_RowId, attribute1, ..., attributeN'));
    }

    ```

    Note that it should return a QueryBuilder object and not a collection of results.
4. Also in the controller add `protected $tableStructureClass = MyTableStructure::class` which should be the fully qualified class name describing the structure of the table rendered in your page
5. In your routes files add the routes for the helper methods, and name them `myRoute.initTable`, `myRoute.getTableData` and, optionally, `myRoute.exportExcel` if you want the results exporting functionality
6. If you need to, don't forget to add user permissions for the new routes
7. In your page/component add:

    ```

    ```
8. Configure the table from the structure class

### Options

[](#options)

- `source` - required, must reference the controllers base route, where both initTable &amp; getTableData endpoints exist
- `extra-filters` - reactive object of the following format ```
    "extraFilters": {
        "table": {
            "field_1" : '',
            "field_2" : '',
        }
    }

    ```
- `custom-params` - extra parameters sent to the back-end for custom logic / queries ```
    "customParams": {
        "orders": {
            dispatched: ''
        }
    }

    ```
- `interval-filters` - where `dbDateFormat` is REQUIRED if the filter values are dates. The given format has to match the database date format ```
    "intervalFilters": {
       "table":{
          "created_at": {
             "min":"value",
             "max":"value",
             "dbDateFormat": "Y-m-d"
          },
          "amount": {
            "min": 0,
            "max": 1000
          }
       }
    }

    ```

### TableStructure

[](#tablestructure)

- `crtNo` - the label for the current number column
- `actionButtons` - array of types of custom buttons to render
- `headerButtons` - array of types of buttons to render above the table header
- `responsePriority` - the priority of columns in responsive mode, i.e. when the content doesn't fit on the screen
- `headerAlign` &amp; `bodyAlign` - type of alignment for the text in cells, eg. 'center'
- `icon` - the icon to be used for the card containing the datatable
- `notSearchable` - simple array w/ the column indexes that are **NOT** searchable using the component search
- `notSortable` - simple array w/ the column indexes that are **NOT** sortable
- `boolean` - array of column indexes that contain values that should be treated as boolean
- `enumMappings` - KV array, where key is the column name, and value is the Enum class name used for translation. These enums contain the translations for the flag-type values in your table, which you want to be presented in a more human friendly way, i.e. `Shipped`/`Delivered` instead of 5 / 6.
- `appends` - optional array of model attributes, which can be appended before returning the query results 1 2
- `columns` - array of arrays. Each inner array contains:
    - `label` - table column header label
    - `data` - the alias of data in query result, eg. 'owner'
    - `name` - the table column used when searching, eg. 'owner.name'

1 If you are appending attributes fetched through a relationship, you'll need to include the model's id attribute in the raw query 2 When using appended attributes, since these do not actually exist in the model's DB table, you need to exclude them using the `notSearchable` option, or you'll get errors when searching

### Config

[](#config)

- `excelRowLimit` - the maximum number of exported entries, when using the export function. You may need to adjust this depending on your server's RAM and PHP settings.

### Publishes

[](#publishes)

- `php artisan vendor:publish --tag=datatable-component` - the VueJS component file
- `php artisan vendor:publish --tag=datatable-options` - the json options file
- `php artisan vendor:publish --tag=datatable-lang` - the default lang files
- `php artisan vendor:publish --tag=datatable-class` - the abstract TableStructure class that must be extended when creating specific structures
- `php artisan vendor:publish --tag=enso-update` - a common alias for when wanting to update the VueJS component, once a newer version is released.

### Notes

[](#notes)

The [Laravel Enso](https://github.com/laravel-enso/Enso) package comes with this package included. There you'll find working examples for using the component

In the snippets folder you'll find a sublime snippet for quickly creating a stub table-structure class

Depends on:

- [Core](https://github.com/laravel-enso/Core) for the user model
- [Helpers](https://github.com/laravel-enso/Helpers) for some generic classes
- [VueComponents](https://github.com/laravel-enso/VueComponents) for the accompanying VueJS components
- [Laravel-Excel](https://github.com/Maatwebsite/Laravel-Excel) for working the excel files

### Contributions

[](#contributions)

are welcome. Pull requests are great, but issues are good too.

### License

[](#license)

This package is released under the MIT license.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 80.6% 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 ~10 days

Recently: every ~101 days

Total

70

Last Release

2644d ago

Major Versions

1.3.1 → 2.0.02017-09-26

1.3.2 → 2.0.22017-10-10

1.3.3 → 2.0.52017-11-08

1.3.4 → 2.0.62017-12-08

PHP version history (2 changes)1.0.0PHP &gt;=5.6.4

1.1.17PHP &gt;=7.1.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16073274?v=4)[Adrian Ocneanu](/maintainers/aocneanu)[@aocneanu](https://github.com/aocneanu)

---

Top Contributors

[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (83 commits)")[![gandesc](https://avatars.githubusercontent.com/u/14071925?v=4)](https://github.com/gandesc "gandesc (20 commits)")

---

Tags

datatabledatatableslaravellaravel-ensolaravel-packageserver-side-datatablevue-componentsdatatabledata tablelaravel-ensodata-table-server-sidedatatables.net

### Embed Badge

![Health badge](/badges/laravel-enso-datatable/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-enso-datatable/health.svg)](https://phpackages.com/packages/laravel-enso-datatable)
```

###  Alternatives

[laravel-enso/tables

Server-side data tables and export backend for Laravel Enso

63254.7k81](/packages/laravel-enso-tables)[unopim/unopim

UnoPim Laravel PIM

10.5k2.2k](/packages/unopim-unopim)[laravel-enso/localisation

Language and translation management for Laravel Enso

1362.3k11](/packages/laravel-enso-localisation)[laravel-enso/data-import

Excel Importer dependency for Laravel Enso

2043.6k6](/packages/laravel-enso-data-import)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)[laravel-enso/tutorials

Tutorial management backend for Laravel Enso

1140.4k](/packages/laravel-enso-tutorials)

PHPackages © 2026

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