PHPackages                             camohub/paginator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. camohub/paginator

ActiveLibrary

camohub/paginator
=================

Paginator for Laravel

1.0.26(4y ago)067mitPHPPHP &gt;=7.0.0

Since Jul 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/camohub/paginator)[ Packagist](https://packagist.org/packages/camohub/paginator)[ RSS](/packages/camohub-paginator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (28)Used By (0)

camohub/paginator
=================

[](#camohubpaginator)

Laravel paginator for routes or route based pagination for Laravel :)
---------------------------------------------------------------------

[](#laravel-paginator-for-routes-or-route-based-pagination-for-laravel-)

This package solves the problem with native Laravel paginator, which generates urls with query string parameters for the page.

```
https://example.com/category?page=4

```

This package allows you to create pretty urls with page parameter according route pattern.

```
https://example.com/category/4
# with fallback to
https://example.com/category?page=4

```

Installation
------------

[](#installation)

```
composer install camohub/paginator

```

Examples
--------

[](#examples)

Lets imagine a controller for articles with route

```
Route::get('/{categorySlug}/{page?}', 'ArticleController@index')->name('articles');

```

The index action displays all articles in required category.

```
public function index(Request $request, $categorySlug, $page = 1)
{
    $category = Category::where('slug', $categorySlug)->first()

    if( ! $category ) abort(404);

    $paginator = new Paginator($request, $category->articles(), 'articles', ['categorySlug' => $categorySlug]);

    $view = [
        'articles' => $paginator->getItems(),
        'paginator' => $paginator,
        'category' => $category,
    ];

    return view('articles.index', $view);
}

```

Paginator \_\_construct() method expects second parameter to be query builder which can call skip() and take() methods to paginate the collection.

Internal implementation looks like

```
$this->items = $this->model->skip($this->skip)->take($this->perPage)->get();

```

and the view will look like

```
@foreach( $articles as $a )
...
@endforeach

{{$paginator->render()}}

```

Options
-------

[](#options)

Paginator requires 3 non optional parameters.

1. Request object
2. Query builder / model
3. Route name

In addition there are few optional parameters which can be used to configure the paginator.

1. Route parameters - route paremeters without page parameter. Page param will be merged in template. Default is \[\].
2. pageParam - the name of the route parameter which represents the page. Default is "page". Packege will look for `$request->route()->parameter($pageParam)` or `$request->query($pageParam)`
3. perPage - items per page. Default is 15.
4. sideItemsCount - the number of items around the current page in paginator. It is ekvivalent of Laravel native -&gt;onEachSide() paginator method. Default is 3.

You can override the whole paginator with simple MyPaginator extends Paginator and also publish the template files and rewrites it. Current template is based on Bootstrap 4.

\##Simple paginator There is also **SimplePaginator** class to create simple prev next navigation.

```
$paginator = new Paginator($request, $category->articles(), 'articles', ['categorySlug' => $categorySlug]);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

27

Last Release

1770d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ad9433afd982997b82d270954a1999c37ac2b20e049928f7594b9977903bde7?d=identicon)[camohub](/maintainers/camohub)

---

Top Contributors

[![camohub](https://avatars.githubusercontent.com/u/8393426?v=4)](https://github.com/camohub "camohub (41 commits)")

### Embed Badge

![Health badge](/badges/camohub-paginator/health.svg)

```
[![Health](https://phpackages.com/badges/camohub-paginator/health.svg)](https://phpackages.com/packages/camohub-paginator)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
