Nqxcode\LuceneSearch\Query\Builder::paginate PHP Метод

paginate() публичный Метод

Execute the current query and return a paginator for the results.
public paginate ( integer $perPage = 25, integer | null $page = null ) : Illuminate\Pagination\Paginator
$perPage integer
$page integer | null
Результат Illuminate\Pagination\Paginator
    public function paginate($perPage = 25, $page = null)
    {
        $page = $page ?: request()->input('page', 1);
        $this->limit($perPage, ($page - 1) * $perPage);
        $models = $this->get()->all();
        $total = $this->count();
        $paginator = new Paginator($models, $total, $perPage);
        return $paginator;
    }