PHPackages                             componenta/http-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. [HTTP &amp; Networking](/categories/http)
4. /
5. componenta/http-pagination

ActiveLibrary[HTTP &amp; Networking](/categories/http)

componenta/http-pagination
==========================

HTTP pagination URL helpers for Componenta

v1.0.0(1mo ago)021MITPHPPHP ^8.4

Since Jun 16Pushed 1mo agoCompare

[ Source](https://github.com/componenta/http-pagination)[ Packagist](https://packagist.org/packages/componenta/http-pagination)[ RSS](/packages/componenta-http-pagination/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (1)

Componenta HTTP Pagination
==========================

[](#componenta-http-pagination)

HTTP helpers for paginated resources. The package connects `componenta/paginator` with PSR-7 request URIs and response arrays.

Use this package when an HTTP API already has a `PaginatorInterface` and needs stable `prev` / `next` URLs and a serializable pagination envelope.

Boundary
--------

[](#boundary)

This package does not calculate pagination itself and does not query storage. Page math and `PaginatorInterface` are provided by `componenta/paginator`. This package only adapts that paginator to HTTP URLs and array responses.

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

[](#installation)

```
composer require componenta/http-pagination
```

Dependencies
------------

[](#dependencies)

PackagePurpose`componenta/paginator`Provides `PaginatorInterface` and pagination metadata.`componenta/arrayable`Provides the `Arrayable` contract used by `ResourcePaginator`.`psr/http-message`Provides PSR-7 request and URI interfaces.Main API
--------

[](#main-api)

`PaginatorUrlBuilder` builds page URLs while preserving the current query string:

```
use Componenta\Http\PaginatorUrlBuilder;

// Current request: /posts?tag=php&limit=20&offset=20
$builder = PaginatorUrlBuilder::fromRequest($request, defaultLimit: 20);

$next = $builder->nextUrl($paginator);
$prev = $builder->prevUrl($paginator);
$page = $builder->pageUrl(3, 20);
```

`PaginatorUrlBuilder::fromRequest()` uses the request URI and the default parameter names `offset` and `limit`. The constructor allows custom parameter names:

```
$builder = new PaginatorUrlBuilder($uri, offsetParam: 'skip', limitParam: 'take');
```

`ResourcePaginator` wraps a paginator and generated links into an arrayable structure for API responses:

```
use Componenta\Http\ResourcePaginator;

$resource = new ResourcePaginator($paginator, $request->getUri());

return $resource->toArray();
```

The default output fields are `count`, `prev`, `next`, `range`, `page`, and `results`. Pass a field list to the constructor to limit the output:

```
$resource = new ResourcePaginator($paginator, $request->getUri(), ['count', 'next', 'results']);
```

Unknown field names are included with `null` values because `ResourcePaginator` preserves the requested field list.

Errors
------

[](#errors)

`PaginatorUrlBuilder` throws `InvalidArgumentException` when the offset or limit parameter name is empty, or when both parameter names are the same. Page and limit values passed to `pageUrl()` are normalized to at least `1`.

Related Packages
----------------

[](#related-packages)

- [`componenta/paginator`](../paginator/README.md) provides the paginator value object.
- [`componenta/arrayable`](../arrayable/README.md) provides the `Arrayable` contract.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance91

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

43d ago

### Community

Maintainers

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

---

Top Contributors

[![Shelamkoff](https://avatars.githubusercontent.com/u/20490712?v=4)](https://github.com/Shelamkoff "Shelamkoff (1 commits)")

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B4.1k](/packages/guzzlehttp-psr7)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k543.5M2.7k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k48](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k17](/packages/tempest-framework)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36789.4k2](/packages/telnyx-telnyx-php)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

185702.8k44](/packages/laudis-neo4j-php-client)

PHPackages © 2026

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