File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 4848 - [XSS filtering](/docs/laravel-datatables/{{version}}/xss)
4949 - [Blacklist Columns](/docs/laravel-datatables/{{version}}/blacklist)
5050 - [Whitelist Columns](/docs/laravel-datatables/{{version}}/whitelist)
51+ - [Set Total Records](/docs/laravel-datatables/{{version}}/set-total-records)
5152- HTML Builder
5253 - [Builder](/docs/laravel-datatables/{{version}}/html-builder)
5354 - [Table](/docs/laravel-datatables/{{version}}/html-builder-table)
Original file line number Diff line number Diff line change 1+ # Set Total Records
2+
3+ In some cases, we need to manually set the total records of our ` Datatables ` and skip its internal counting functionality.
4+ To achieve this, we can use ` setTotalRecords($count) ` api.
5+
6+ ``` php
7+ use Datatables;
8+
9+ Route::get('user-data', function() {
10+ $model = App\User::query();
11+
12+ return Datatables::eloquent($model)
13+ ->setTotalRecords(100)
14+ ->make(true);
15+ });
16+ ```
You can’t perform that action at this time.
0 commit comments