Skip to content
Icon

WARNING You're browsing the documentation for an upcoming version of Laravel DataTables. The documentation and features of this release are subject to change.

Order by NULLS LAST

This api will set DataTables to perform ordering with NULLS LAST option.

use DataTables;
 
Route::get('user-data', function() {
$model = App\User::query();
 
return DataTables::eloquent($model)
->orderByNullsLast()
->toJson();
});

You must update nulls_last_sql config and use a pattern that matches your DB Driver.