PHPackages                             roquie/laravel-perpage-resolver - 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. [Database &amp; ORM](/categories/database)
4. /
5. roquie/laravel-perpage-resolver

ActiveLibrary[Database &amp; ORM](/categories/database)

roquie/laravel-perpage-resolver
===============================

Add a few feature to resolve per\_page query parameter globally.

2.0.0(5y ago)52.9k2MITPHPPHP &gt;=8.0

Since Feb 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/roquie/laravel-perpage-resolver)[ Packagist](https://packagist.org/packages/roquie/laravel-perpage-resolver)[ RSS](/packages/roquie-laravel-perpage-resolver/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (8)Dependencies (7)Versions (10)Used By (0)

Laravel PerPage Resolver
========================

[](#laravel-perpage-resolver)

[![Build Status](https://camo.githubusercontent.com/4464798e11e945dec4b8f030868625394ba271ea7dcbc9e24009f43a8840c001/68747470733a2f2f7472617669732d63692e6f72672f726f717569652f6c61726176656c2d706572706167652d7265736f6c7665722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/roquie/laravel-perpage-resolver)[![Coverage Status](https://camo.githubusercontent.com/bff0ce185fe96f0f70adff03e523bf02a50aaef59577fd4e2e5208864cd4e742/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f726f717569652f6c61726176656c2d706572706167652d7265736f6c7665722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/roquie/laravel-perpage-resolver?branch=master)

This package add the same method `perPageResolver` like as `currentPageResolver`. Now, `?per_page=100` parameter have a globally access for all models (like `?page=2`).

How to use
----------

[](#how-to-use)

For the beginning, install composer package:

```
composer require roquie/laravel-perpage-resolver

```

Second, apply a service provider it's here (if you use Laravel 5.5+ [it's no need anymore](https://laravel-news.com/package-auto-discovery)):

```
// config/app.php, the providers array
// ...
Roquie\LaravelPerPageResolver\PerPageResolverServiceProvider::class,
```

Third, you can use `PerPageResolverTrait` in your models (recommended):

```
use Illuminate\Database\Eloquent\Model;
use Roquie\LaravelPerPageResolver\PerPageResolverTrait;

class User extends Model
{
    use PerPageResolverTrait;
// ...
```

... or extends package Model class:

```
class User extends \Roquie\LaravelPerPageResolver\Model
{
// ...
```

Run it!

Upgrade
-------

[](#upgrade)

3. So, if you update the package from `1.*` to `2.*` version what you need to know:

- it breaks backwards compatibility
- supported ONLY PHP 8.0
- supported ONLY Laravel ^8, ^9.
- updated a `illuminate/database` package to `^8` due to security reason.

2. So, if you update the package from `1.1.0` to `1.2.*` version what you need to know:

- backward compatibility there is
- supported PHP 8.0, 7.4, 7.3
- supported Laravel ^5, ^6, ^7, ^8, ^9.

1. So, if you update the package from `1.0.0` to `1.1.0` version what you need to know:

- backward compatibility there is
- fixed "bug", when other query parameters does not append to uri
- added package-auto-discovery functional.

Tests
-----

[](#tests)

100% code coverage. Includes integration tests.

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2021 Roquie

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity74

Established project with proven stability

 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 ~215 days

Recently: every ~300 days

Total

8

Last Release

1868d ago

Major Versions

0.1.1 → 1.0.02017-09-01

1.2.1 → 2.0.02021-03-31

PHP version history (2 changes)1.2.0PHP &gt;=7.3

2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/35d8eff4a3e66b58f3e2af56fe948035469de1e19ac29c532d65c681955bbd18?d=identicon)[Roquie](/maintainers/Roquie)

---

Top Contributors

[![roquie](https://avatars.githubusercontent.com/u/3214290?v=4)](https://github.com/roquie "roquie (25 commits)")

---

Tags

eloquentlaravellimitpaginatepaginationperpage

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/roquie-laravel-perpage-resolver/health.svg)

```
[![Health](https://phpackages.com/badges/roquie-laravel-perpage-resolver/health.svg)](https://phpackages.com/packages/roquie-laravel-perpage-resolver)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8703.0M17](/packages/yajra-laravel-oci8)[mehdi-fathi/eloquent-filter

Eloquent Filter adds custom filters automatically to your Eloquent Models in Laravel.It's easy to use and fully dynamic, just with sending the Query Strings to it.

450191.6k1](/packages/mehdi-fathi-eloquent-filter)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)

PHPackages © 2026

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