count(); return self::paginator($results->forPage($page, $pageSize), $total, $pageSize, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => 'page', ]); } /** * Create a new length-aware paginator instance. * * @param \Illuminate\Support\Collection $items * @param integer $total * @param integer $perPage * @param integer $currentPage * @param array $options * @return \Illuminate\Pagination\LengthAwarePaginator */ protected static function paginator(Collection $items, int $total, int $perPage, int $currentPage, array $options) { return Container::getInstance()->makeWith(LengthAwarePaginator::class, [ 'items' => $items, 'total' => $total, 'perPage' => $perPage, 'currentPage' => $currentPage, 'options' => $options ]); } }