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

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

iyogesharma/datatable-laravel
=============================

package to help in handling both server and client side datatable.js operations

4.21(1mo ago)12657[1 issues](https://github.com/iYogesharma/datatable-laravel/issues)MITPHPPHP &gt;=7.0.0

Since Apr 1Pushed 2w ago2 watchersCompare

[ Source](https://github.com/iYogesharma/datatable-laravel)[ Packagist](https://packagist.org/packages/iyogesharma/datatable-laravel)[ RSS](/packages/iyogesharma-datatable-laravel/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (8)Versions (31)Used By (0)

 [![](https://github.com/iYogesharma/datatable-laravel/raw/master/logo.png)](https://github.com/iYogesharma/datatable-laravel/blob/master/logo.png)

[![Latest Stable Version](https://camo.githubusercontent.com/b68ab491040cfdb77cf48f6125eea2ad72f1191fd352341a4679503d7254bca5/68747470733a2f2f706f7365722e707567782e6f72672f69796f6765736861726d612f646174617461626c652d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/iyogesharma/datatable-laravel)[![Total Downloads](https://camo.githubusercontent.com/7f76436336f586b712781a85a5d9e6689ca2645a2cecc402fbe62b344ee7ae1d/68747470733a2f2f706f7365722e707567782e6f72672f69796f6765736861726d612f646174617461626c652d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/iyogesharma/datatable-laravel)[![License](https://camo.githubusercontent.com/4167a966184fb384c3f685cca8199fa784aa6270eec2d91279ec425b3fe4f5de/68747470733a2f2f706f7365722e707567782e6f72672f69796f6765736861726d612f646174617461626c652d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/iyogesharma/datatable-laravel)

jQuery Datatables For Laravel
=============================

[](#jquery-datatables-for-laravel)

A simple package to ease datatable.js server side operations

This package is created to handle [server-side](https://www.datatables.net/manual/server-side) and [client-side](https://www.datatables.net/manual) works of [DataTables](http://datatables.net) jQuery Plugin via [AJAX option](https://datatables.net/reference/option/ajax) by using Eloquent ORM, Query Builder or Collection.

datatable-laravel 4.x
---------------------

[](#datatable-laravel-4x)

Version 4.x continues the improvements in version 3.x by introducing some new features

New
---

[](#new)

- Added support for select raw queries
- Auto guess column names if no columns are provided in request
- Auto guess column names if \* is provided in column names
- Added support for group by and havig clause
- Example

    ```
      echo  datatable(User::select('users.name','users.email','users.contact_no','users.role_id')
        ->selectRaw("
            Max(id) as total
       ")
       ->groupBy('users.name', 'users.email', 'users.contact_no'))->init();

      echo   datatable(User::select('users.*'))->init();
    ```
- Added Support For Data Filtering From Client Side
- Added Column Wise Search Query Support Using Below Api
- Example

    ```
    {
      "columns": [
        {
          "data": "name",
          "name": "name",
          "searchable": true,
          "orderable": true,
          "search": {
            "value": "",
            "regex": false
          }
        }
      ],
      "start": 0,
      "length": 10,
      "search": {
        "value": "Yoges",
        "regex": false
      },
      "filters": {
        "role_id" : [1,2],// role id in 1,2
        "created_at": [date1, date2], // createde at is between date1 and date2,
        "name": "iyogesh" // where name = iyogesh
      }
    }
    ```

Modified
--------

[](#modified)

Modified datatable function to support server side export to xls,csv and json

You just need to pass 2 new arguments in query-string/body `export` and `ext`

if `export = true` it will return download file response for `ext` default value is `xlsx`

```
    https://datatable-url?export=true&ext=xlsx
```

Using Helper Function
---------------------

[](#using-helper-function)

```
echo datatable()->of(User::query())->init();
echo datatable()->of(DB::table('users')->join1()->join2()->select(column1,column2,...columnK))->init();
echo datatable()->of(DB::table('users'))->init();
echo datatable()->of(User::all())->init();

echo datatables(User::query());
echo datatables(DB::table('users')->join1()->join2()->select(column1,column2,...columnK));
echo datatables(DB::table('users'));
echo datatables(User::all());
```

Using Facade
------------

[](#using-facade)

```
use Datatable;

echo Datatable::of(User::query())->init();
echo Datatable::of(DB::table('users')->join1()->join2()->select(column1,column2,...columnK))->init();
echo Datatable::of(DB::table('users'))->init();
echo Datatable::of(User::all())->init();

echo Datatable::make(User::query());
echo Datatable::make(DB::table('users')->join1()->join2()->select(column1,column2,...columnK));
echo Datatable::make(DB::table('users'));
echo Datatable::make(User::all());
```

Add/Edit Column
---------------

[](#addedit-column)

```
use Datatable;

echo Datatable::of(User::query())->add(columnName,function($user){
    return "$user->name";
})->init();
```

Using Helper Function
---------------------

[](#using-helper-function-1)

```
echo datatable()->of(User::query())->add(columnName,function($user){
    return "$user->name";
})->init();
```

Add/Edit Multiple Columns
-------------------------

[](#addedit-multiple-columns)

```
use Datatable;

echo Datatable::of(User::query())->addColumns([columnName1=>function($user){
    return "$user->name";
},columnName2=>function($user){
    return "$user->name";
}...])->init();
```

Remove Column
-------------

[](#remove-column)

```
use Datatable;

echo Datatable::of(User::query())->remove(columnName)->init();
```

Remove Multiple Columns
-----------------------

[](#remove-multiple-columns)

```
use Datatable;

echo Datatable::of(User::query())->remove([columnName1,columnName2,...])->init();
```

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

[](#requirements)

- [PHP &gt;= 7.0](http://php.net/)
- [Laravel 7.x](https://github.com/laravel/framework)
- [jQuery DataTables v1.10.x](http://datatables.net/)
- You can check previous release for different version of laravel

Quick Installation
------------------

[](#quick-installation)

```
$ composer require iyogesharma/datatable-laravel:"~1.0"
```

#### Service Provider &amp; Facade (Optional on Laravel 5.5)

[](#service-provider--facade-optional-on-laravel-55)

Register provider and facade on your `config/app.php` file.

```
'providers' => [
    ...,
    YS\Datatable\DatatableServiceProvider::class,
]

'aliases' => [
    ...,
    'Datatable' => YS\Datatable\Facades\Datatable::class,
     "Table"=>YS\\Datatable\\Facades\\Table::class
]
```

load css files
--------------

[](#load-css-files)

before `` tag add

```
    {{table()->css()}}
```

load script files
-----------------

[](#load-script-files)

before `` tag add

```
    {{table()->scripts()}}
```

load Dependencies (css/js)
--------------------------

[](#load-dependencies-cssjs)

before `` tag add

```
    {{table()->dependencies()}}
```

Initialize Basic DataTable
--------------------------

[](#initialize-basic-datatable)

In HTMl file inside document .ready function write

```
    {{table()->basic()}}
```

Initialize Ajax DataTable
-------------------------

[](#initialize-ajax-datatable)

In HTMl file inside document .ready function write

```
    {{table()->ajax($url,$columns,$configs)}}
```

Example
-------

[](#example)

```
    {{table()->dependencies()}}

        $(document).ready(function(){
                {{ table()->ajax('ddd/ddd',
                    [   'name',
                        'email',
                        'office'
                    ],[
                        'paging'=>'true',
                        'fixedheader'=>'true',
                        'buttons'=>['colvis','copy','csv','print'],
                        'order'=>[[0,'desc']],
                        'lengthMenu'=> [[ 10, 20, 30, 40, 50], [ 10, 20, 30, 40, 50]],
                    ]
                )}}
        })

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/iYogesharma/datatables/blob/master/LICENSE.md) for more information.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance93

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

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

Recently: every ~16 days

Total

29

Last Release

34d ago

Major Versions

v1.0.2.x-dev → v2.0.x-dev2019-11-06

1.0.3 → 2.x-dev2020-05-15

2.0 → v3.0.x-dev2021-01-05

3.6.2 → 4.02024-10-21

3.6.4 → 4.x-dev2026-05-26

PHP version history (3 changes)1.0.0PHP ^7.0.0

1.0.1PHP &gt;=7.0.0

v3.0.x-devPHP ^7.2.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44565761?v=4)[Yogesh Sharma](/maintainers/iYogesharma)[@iYogesharma](https://github.com/iYogesharma)

---

Top Contributors

[![iYogesharma](https://avatars.githubusercontent.com/u/44565761?v=4)](https://github.com/iYogesharma "iYogesharma (82 commits)")

---

Tags

datatablesjquery-datatableslaravellaravel-server-side-renderquery-builderys-datatableslaraveldatatableiYogesharma

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

98145.2k3](/packages/nickurt-laravel-akismet)[tomshaw/electricgrid

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

119.2k](/packages/tomshaw-electricgrid)[creasi/laravel-nusa

A Laravel package that aim to provide Indonesia' Administrative Data

997.7k2](/packages/creasi-laravel-nusa)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1319.7k3](/packages/team-nifty-gmbh-tall-datatables)

PHPackages © 2026

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