Download the PHP package livecontrol/eloquent-datatable without Composer
On this page you can find all versions of the php package livecontrol/eloquent-datatable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download livecontrol/eloquent-datatable
More information about livecontrol/eloquent-datatable
Files in livecontrol/eloquent-datatable
Package eloquent-datatable
Short Description Eloquent DataTable plugin for server side ajax call handling.
License MIT
Informations about the package eloquent-datatable
EloquentDataTable
Eloquent compatible DataTable plugin for server side ajax call handling.
If you are familiar with eloquent and would like to use it in combination with datatables this is what you are looking for.
Usage
Step 1: Install through composer
Step 2: Add DataTables javascript and set it up
For more information check out the datatables manual. Make sure you have csrf requests working with jquery ajax calls.
Step 3: Use it
Optional step 4: Set versions of DataTables plugin.
Just initialize the DataTable object as you would normally and call the setVersionTransformer function as in the following example (for version 1.09 of DataTables):
By default the plugin will be loading the transformer which is compatible with DataTables version 1.10.
Examples
- Basic setup
- Combining columns
- Using raw column queries
- Return custom row format
- Showing results with relations
Basic example
In this case we are making a datatable response with all users who live in London.
Combining columns
If you want to combine the firstname and lastname into one column, you can wrap them into an array.
Using raw column queries
Sometimes you want to use custom sql statements on a column to get specific results,
this can be achieved using the ExpressionWithName
class.
Return custom row format
If you would like to return a custom row format you can do this by adding an anonymous function as an extra argument to the make method.