PHPackages                             desmart/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. desmart/pagination

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

desmart/pagination
==================

Laravel pagination on steroids

1.2.1(11y ago)419.1k7[1 issues](https://github.com/DeSmart/pagination/issues)MITPHPPHP &gt;=5.4.0

Since Jun 11Pushed 10y ago13 watchersCompare

[ Source](https://github.com/DeSmart/pagination)[ Packagist](https://packagist.org/packages/desmart/pagination)[ RSS](/packages/desmart-pagination/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (10)Used By (0)

Overview
--------

[](#overview)

[![Build Status](https://camo.githubusercontent.com/8dcee4406074d9f1ed8403cf24c6ad691ebd9d389b01355f4d3c9e69a62f050c/68747470733a2f2f6170692e7472617669732d63692e6f72672f4465536d6172742f706167696e6174696f6e2e706e67)](https://travis-ci.org/DeSmart/pagination)

This package is an extension for Laravel4 pagination module.

It provides new functionalities:

- route based url generator
- helpers for template render

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

[](#installation)

To `composer.json` add: `"desmart/pagination": "1.2.*"` and then run `composer update desmart/pagination`.

In `app/config/app.php` replace line `'Illuminate\Pagination\PaginationServiceProvider',` with `'DeSmart\Pagination\PaginationServiceProvider',`.

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

[](#compatibilty)

This package should not break compatibility with Laravel pagination module.

### Laravel 4.1

[](#laravel-41)

To use `desmart/pagination` with Laravel 4.1 switch to version `1.1.*`.

### Laravel 4.0

[](#laravel-40)

To use `desmart/pagination` with Laravel 4.0 switch to version `1.0.*`.

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`)
- `useCurrentRoute()` - use current (active) route for url generating

### 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 controller

[](#in-controller)

```
// example route (app/routes.php)
Route::get('/products/{page}.html', array('as' => 'products.list', 'uses' => ''));

// use the current route
$list = Product::paginate(10)
  ->useCurrentRoute()
  ->pagesProximity(3);

// use custom route
$list = Product::paginate(10)
  ->route('products.list')
  ->pagesProximity(3);
```

### In view

[](#in-view)

```
// app/view/products/list.blade.php

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

{{ $list->links('products.paginator') }}

// app/view/products/paginator.blade.php

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

License
-------

[](#license)

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

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 78.6% 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 ~90 days

Recently: every ~115 days

Total

8

Last Release

4130d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

1.2.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/488bdbbb3187d1f4f6d9c92f0c716ad413f5e7fe53d3ec5ffefb37cfcad4ecf6?d=identicon)[radmen](/maintainers/radmen)

![](https://www.gravatar.com/avatar/92bc27fc8f1cba837cef419eee0fae358f52c804cd5450cf994f9095fa387a5c?d=identicon)[DeSmart](/maintainers/DeSmart)

---

Top Contributors

[![radmen](https://avatars.githubusercontent.com/u/1190255?v=4)](https://github.com/radmen "radmen (11 commits)")[![valeryan](https://avatars.githubusercontent.com/u/1508761?v=4)](https://github.com/valeryan "valeryan (2 commits)")[![maksimkurb](https://avatars.githubusercontent.com/u/1351924?v=4)](https://github.com/maksimkurb "maksimkurb (1 commits)")

---

Tags

laravelpagination

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k28.4M137](/packages/laravel-cashier)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8405.5M96](/packages/laravel-doctrine-orm)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

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