Skip to content

Commit 392ba8c

Browse files
committed
Set total records docs.
1 parent efe7aa1 commit 392ba8c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
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)

set-total-records.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
```

0 commit comments

Comments
 (0)