PHPackages                             publicoms/laravel-custom-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. publicoms/laravel-custom-paginator

ActiveLibrary

publicoms/laravel-custom-paginator
==================================

Paginate based on last item, not pages.

02.2kPHP

Since Mar 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/publicoms/laravel-custom-paginator)[ Packagist](https://packagist.org/packages/publicoms/laravel-custom-paginator)[ RSS](/packages/publicoms-laravel-custom-paginator/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Item Paginator
======================

[](#laravel-item-paginator)

Paginate based on last item, not page.

[![Build Status](https://camo.githubusercontent.com/8336fb6a466f64560725e96472f2064b9a2ea715b5a5843a4f55decbe9aba9d2/68747470733a2f2f7472617669732d63692e6f72672f41736b6564696f2f6c61726176656c2d6974656d2d706167696e6174652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Askedio/laravel-item-paginate)[![StyleCI](https://camo.githubusercontent.com/6cf4d3e51a43ed4da1ea326bf35aa7755b015adcaa9b56c0a46dbaf940f26d47/68747470733a2f2f7374796c6563692e696f2f7265706f732f36343733363935372f736869656c64)](https://styleci.io/repos/64736957)[![Codacy Badge](https://camo.githubusercontent.com/9a851eb3783e2beb5ce8017d721c4bd7495334d574c9ed232ca478546a56531f/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3762306530326637323865653439356638333238633636303365633234633162)](https://www.codacy.com/app/gcphost/laravel-item-paginate?utm_source=github.com&utm_medium=referral&utm_content=Askedio/laravel-item-paginate&utm_campaign=Badge_Grade)[![Codacy Badge](https://camo.githubusercontent.com/7653cb85d0f558e56451305b7de3637a142db4381e335a5611e29b6b53f29e78/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3762306530326637323865653439356638333238633636303365633234633162)](https://www.codacy.com/app/gcphost/laravel-item-paginate?utm_source=github.com&utm_medium=referral&utm_content=Askedio/laravel-item-paginate&utm_campaign=Badge_Coverage)

Installation
============

[](#installation)

```
composer require publicoms/laravel-custom-paginator

```

Add the following trait to your Models.

```
use \publicoms\ItemPaginator\ItemPaginatorTrait;
```

Add the following provider to `config/app.php`

```
\publicoms\ItemPaginator\ItemPaginatorServiceProvider::class,
```

Usage
=====

[](#usage)

This package is based off simplePaginate and will take the same parameters.

```
$users = new User();

$paginated = $users->itemPaginate();

dd($paginated);
```

The last parameter is the field that will be used to paginate by, defaults to `id`.

```
itemPaginate($perPage = null, $columns = ['*'], $pageName = 'from', $from = 0, $field = null)
```

ORDER BY DESC
=============

[](#order-by-desc)

If you want to decend your sorting you'll want to use `itemPaginateDesc` instead of `itemPaginate`. The first page will add an extra query to find the last item.

Example Output
==============

[](#example-output)

```
array:6 [
  "limit" => 2
  "next_page_url" => "http://localhost?from=190"
  "from" => 100
  "to" => 190
  "data" => array:2 [
    0 => array:8 [
      "id" => 100
      "name" => "test"
      "email" => "test@test.com"
      "password" => "test"
      "remember_token" => null
      "created_at" => "2016-08-02 18:13:19"
      "updated_at" => "2016-08-02 18:13:19"
      "deleted_at" => null
    ]
    1 => array:8 [
      "id" => 190
      "name" => "test2"
      "email" => "test2@test.com"
      "password" => "test"
      "remember_token" => null
      "created_at" => "2016-08-02 18:13:19"
      "updated_at" => "2016-08-02 18:13:19"
      "deleted_at" => null
    ]
  ]
]
```

Disclaimer
==========

[](#disclaimer)

### Will only sort by incremental ids.

[](#will-only-sort-by-incremental-ids)

I've only tested this with `sqlite` and `mysql` (see tests) so it may not work in every situation. Please report any you find.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/80394219?v=4)[publicoms](/maintainers/publicoms)[@publicoms](https://github.com/publicoms)

---

Top Contributors

[![bazxkarim](https://avatars.githubusercontent.com/u/128174862?v=4)](https://github.com/bazxkarim "bazxkarim (5 commits)")

### Embed Badge

![Health badge](/badges/publicoms-laravel-custom-paginator/health.svg)

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

PHPackages © 2026

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