/** * Perform necessary filters. * * @return void */ public function filterRecords() { if ($this->autoFilter && $this->request->isSearchable()) { $this->filtering(); } if (is_callable($this->filterCallback)) { call_user_func($this->filterCallback, $this->filterCallbackParameters); } $this->columnSearch(); $this->filteredRecords = $this->isFilterApplied ? $this->count() : $this->totalRecords; }
/** * Organizes works. * * @param bool $mDataSupport * @param bool $orderFirst * @return \Illuminate\Http\JsonResponse */ public function make($mDataSupport = false, $orderFirst = false) { $this->totalRecords = $this->count(); if ($orderFirst) { $this->ordering(); } if ($this->autoFilter && $this->request->isSearchable()) { $this->filtering(); } $this->columnSearch(); $this->filteredRecords = $this->isFilterApplied ? $this->count() : $this->totalRecords; if (!$orderFirst) { $this->ordering(); } $this->paginate(); return $this->render($mDataSupport); }