File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,19 @@ public function setTotalRecords($total)
413
413
return $ this ;
414
414
}
415
415
416
+ /**
417
+ * Set filtered records manually.
418
+ *
419
+ * @param int $total
420
+ * @return $this
421
+ */
422
+ public function setFilteredRecords ($ total )
423
+ {
424
+ $ this ->filteredRecords = $ total ;
425
+
426
+ return $ this ;
427
+ }
428
+
416
429
/**
417
430
* Skip pagination as needed.
418
431
*
@@ -540,6 +553,16 @@ public function toJson($options = 0)
540
553
return $ this ->make ();
541
554
}
542
555
556
+ /**
557
+ * Count filtered items.
558
+ *
559
+ * @return int
560
+ */
561
+ protected function filteredCount ()
562
+ {
563
+ return $ this ->filteredRecords ? $ this ->filteredRecords : $ this ->count ();
564
+ }
565
+
543
566
/**
544
567
* Perform necessary filters.
545
568
*
@@ -556,7 +579,7 @@ protected function filterRecords()
556
579
}
557
580
558
581
$ this ->columnSearch ();
559
- $ this ->filteredRecords = $ this ->isFilterApplied ? $ this ->count () : $ this ->totalRecords ;
582
+ $ this ->filteredRecords = $ this ->isFilterApplied ? $ this ->filteredCount () : $ this ->totalRecords ;
560
583
}
561
584
562
585
/**
You can’t perform that action at this time.
0 commit comments