Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 600 Bytes

index-column.md

File metadata and controls

19 lines (14 loc) · 600 Bytes

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)
				->addIndexColumn()
				->toJson();
});

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_RowIndex