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 5353 - [Whitelist Columns](/docs/{{package}}/{{version}}/whitelist)
5454 - [Set Total Records](/docs/{{package}}/{{version}}/set-total-records)
5555 - [With Trashed](/docs/{{package}}/{{version}}/with-trashed)
56+ - [Only Trashed](/docs/{{package}}/{{version}}/only-trashed)
5657 - [Skip Paging](/docs/{{package}}/{{version}}/skip-paging)
5758- HTML Builder
5859 - [Builder](/docs/{{package}}/{{version}}/html-builder)
Original file line number Diff line number Diff line change 1+ # Eloquent Model With Only Trashed
2+
3+ When our ` Model ` uses ` SoftDeletes ` trait of Laravel, we need to implicitly tell ` Datatables ` to include only trashed records in the results.
4+ To achieve this, we can use ` onlyTrashed ` api.
5+
6+ ``` php
7+ use Datatables;
8+
9+ Route::get('user-data', function() {
10+ $model = App\User::onlyTrashed()->query();
11+
12+ return Datatables::eloquent($model)
13+ ->onlyTrashed()
14+ ->make(true);
15+ });
16+ ```
You can’t perform that action at this time.
0 commit comments