Skip to content

Skip Total Records

[!WARNING] This feature is deprecated in v10. Use setTotalRecords instead.

Skip total records aims to improve DataTables response time by skipping the total records count query and setting its value equals to the filtered total records.


Example

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

See Also