PHPackages                             thinkme/pagination - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. thinkme/pagination

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thinkme/pagination
==================

Laravel pagination on steroids

5.3.x-dev(9y ago)2281MITPHPPHP &gt;=5.4.0

Since Feb 17Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (2)Used By (0)

Overview
--------

[](#overview)

if use laravel4.0/laravel4.1/laravel4.2 click this:

This package is an extension for Laravel5 pagination module. Modified from desmart / pagination Thanks radmen

It provides new functionalities:

- route based url generator
- helpers for template render

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

[](#installation)

To `composer.json` add: `"thinkme/pagination": "dev-master"` and then run `composer update thinkme/pagination`.

Compatibilty
------------

[](#compatibilty)

This package should not break compatibility with Laravel pagination module.

### Laravel 5.0/5.1/5.2/5.3/5.4/5.5

[](#laravel-505152535455)

Method overview
---------------

[](#method-overview)

### General usage

[](#general-usage)

- `withQuery()` - bind query parameters to url generator (by default query parameters are included). Works only for url generating from routes.
- `withoutQuery()` - don't bind query parameters
- `route($route[, array $parameters])` - use given route for generating url to pages (it can be route name, or instance of `Illuminate\Routing\Route`)

### For templates

[](#for-templates)

- `pagesProximity($proximity)` - set pages proximity
- `getPagesRange()` - get list of pages to show in template (includes proximity)
- `canShowFirstPage()` - check if can show first page (returns `TRUE` when first page is not in list generated by `getPagesRange()`)
- `canShowLastPage()` - check if can show last page (returns `TRUE` when last page is not in list generated by `getPagesRange()`)

Example usage
-------------

[](#example-usage)

### In router

[](#in-router)

```
// example route (routes.php)
Route::get('list-{page}.html', ['as' => 'list.page', 'uses' => 'PhotoController@index']);
```

### In controller

[](#in-controller)

```
// IF use the current route
$list = new Paginator();
$list = list->make($item, $count, 1, $page, [
            'path' => Paginator::resolveCurrentPath(),
        ]);
$list->route('list.page');
$list->pagesProximity(3);

// or quick paginator
$query = User::select($columns);
$paginate = new Paginator();
$paginate->paginate($query, 10);//or $paginate->paginate($query, $perPage, $currentPage);
//or $list = $paginate ^#*&!^#*!^&*(!&#) You know;
//return $list
return $paginate;

//IF you do not want to use the default page name. Example: http://test.com?page=1 to http://test.com?p=1
$paginate->paginate($query, $perPage, $currentPage, ['pageName' => 'p']);//http://test.com?p=1
//or
$paginate->setPageName('p');

// IF use yourself Presenter Class
Paginator::presenter(function() use ($list) {
            return new MyPresenter($list);
        });
```

### In view

[](#in-view)

```
// list.blade.php

@foreach ($list as $item)
{{-- show item --}}
@endforeach

{!! $list->links('paginator') !!}

// if use yourself Presenter Class

{!! $list->render() !!}

// paginator.blade.php

@if ($paginator->lastPage() > 1)
  @foreach ($paginator->getPagesRange() as $page)
    {{ $page }}
  @endforeach
@endif

// or this

@if ($paginator->lastPage() > 1)

        @if($paginator->currentPage()>1)

        @else

        @endif
            @foreach ($paginator->getPagesRange() as $page)
                @if($paginator->currentPage()==$page)
                    {{$page}}
                @else
                    {{$page}}
                @endif
            @endforeach
            @if($paginator->currentPage()lastPage())

            @else

            @endif

@endif
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

3378d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/abb6a14b65dca660f4180714d6343f5eb0baabb027682c500c5c77003daa3cd0?d=identicon)[thinkworld](/maintainers/thinkworld)

---

Top Contributors

[![ThinkMe](https://avatars.githubusercontent.com/u/4425245?v=4)](https://github.com/ThinkMe "ThinkMe (27 commits)")

---

Tags

laravelpagination

### Embed Badge

![Health badge](/badges/thinkme-pagination/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[zonneplan/laravel-module-loader

Module loader for Laravel

24118.4k](/packages/zonneplan-laravel-module-loader)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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