Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Laravel Datatables Bundle helps to handle server-side works of Datatables Jquery Plugin
Pull request Compare This branch is 8 commits behind bllim:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Datatables Bundle for Laravel


This bundle is created to handle server-side works of DataTables Jquery Plugin ( by using Eloquent ORM or Fluent Query Builder.



  • Make method returns output by using "Larevel Response" instead of printing (!important)
  • Bundle logs output if profiler is active
  • Some bugs are fixed

Feature Overview

  • Supporting Eloquent ORM and Fluent Query Builder
  • Adding or editing content of columns and removing columns
  • Templating new or current columns via Blade Template Engine


Install with artisan

php artisan bundle:install datatables

or clone the project into bundles/datatables.

Then, update your bundles.php to auto-start the bundle.

return array(
    'datatables' => array( 'auto' => true ),


It is very simple to use this bundle. Just create your own fluent query object or eloquent object without getting results (that means don't use get(), all() or similar methods) and give it to Datatables. You are free to use all Eloquent ORM and Fluent Query Builder features.

It is better, you know these:

  • When you use select method on Eloquent or Fluent Query, you choose columns
  • You can easily edit columns by using edit_column($column,$content)
  • You can remove any column by using remove_column($column) method
  • You can add columns by using add_column($column_name, $content)
  • You can use Blade Template Engine in your $content values
  • The name of columns is set by returned array.
    • That means, for '' it is 'id' and also for ' as ownername' it is 'ownername'


Example 1:

$posts = Post::select(array('','','posts.created_at','posts.status'));

return Datatables::of($posts)->make();

Example 2:

$place = Place::left_join('owner','places.author_id','=','')
                ->select(array('','','places.created_at',' as ownername','places.status'));

return Datatables::of($place)
->add_column('operations','<a href="{{ URL::to_route( \'\', array( \'edit\',$id )) }}">edit</a>
                <a href="{{ URL::to_route( \'\', array( \'delete\',$id )) }}">delete</a>
->edit_column('ownername','Author of this post is {{ $ownername }}')

Notice: If you use double quotes while giving content of add_column or edit_column, you should escape variables with backslash () else you get error. For example:

edit_column('id',"- {{ \$id }}") .

License: Licensed under the MIT License

Something went wrong with that request. Please try again.