Skip to content

WARNING You're browsing the documentation for an old version of LARAVEL-DATATABLES. Consider upgrading your project to laravel-datatables 10.0.

Index Column

In some cases, you need to track the index of the records on your response. To achieve this, you can add an index column on your response by using addIndexColumn api.

use Datatables;
Route::get('user-data', function() {
$model = App\User::query();
return Datatables::eloquent($model)

Using addIndexColumn will add another column on your response with a column name that is set on index_column configuration. The default index column name is DT_Row_Index