PHPackages                             laraish-maintain/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. [Framework](/categories/framework)
4. /
5. laraish-maintain/pagination

ActiveLibrary[Framework](/categories/framework)

laraish-maintain/pagination
===========================

A simple library for generating pagination, updated fork.

v3.1(2y ago)1191MITPHPPHP ^8.0

Since Nov 29Pushed 2y agoCompare

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

READMEChangelogDependencies (3)Versions (3)Used By (1)

This is a simple PHP library for creating pagination.

Basic Usage
===========

[](#basic-usage)

Here is an example for creating the pagination in WordPress.

```
global $wp_query;

// The total number of items
$total       = (int)$wp_query->found_posts;

// The number of items are going to be displayed per page.
$perPage     = (int)$wp_query->query_vars['posts_per_page'];

// The current page number.
$currentPage = (int)$wp_query->query_vars['paged'];

// additional options
$options     = ['urlStyle' => 'pretty'];

$paginator   = new Paginator($total, $perPage, $currentPage, $options);

echo $paginator->toHtml();
```

Customize the markup
--------------------

[](#customize-the-markup)

If you don't like the default markup, you can specify your own view file to output the markup.

```
$paginator = new Paginator($total, $perPage, $currentPage, ['view'=> '/www/var/example.com/pagination.php']);
```

You can also specify the view with using the dot notation, for example `['view'=> 'components.pagination']`; by using the dot notation it will try to use the [Blade Templates](https://laravel.com/docs/master/blade) if possible.

Take a look at the [preset views](https://github.com/laraish/pagination/tree/master/resources/views) for more details.

Options
=======

[](#options)

onEachSide
----------

[](#oneachside)

TypeDefaultint3The number of links on each side of the center link.

type
----

[](#type)

TypeDefaultstring'default'The rendering type.

- `default`
- `menu`
- `simple`

view
----

[](#view)

TypeDefaultstringnullThe path of view file.

Could be either a blade template or a regular php file.
If you wish to use a php file, you should add the `.php` at the end of the string.

urlStyle
--------

[](#urlstyle)

TypeDefaultstring'pretty'The link style.

- `pretty`: example.com/news/page/10
- `queryString`: example.com/news/?page=10

nextPageText
------------

[](#nextpagetext)

TypeDefaultstring'»'The next page link text.

prevPageText
------------

[](#prevpagetext)

TypeDefaultstring'«'The previous page link text.

path
----

[](#path)

TypeDefaultstringnullThe user-defined base path.

suffix
------

[](#suffix)

TypeDefaultstring''The suffix to be added to the very end of the url. Such as fragment or query-strings.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% 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 ~323 days

Total

2

Last Release

934d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ea3cf6aa139435ff58a364e6447b6647835a452993f2df726515a7c4d028658?d=identicon)[thanasisxan](/maintainers/thanasisxan)

---

Top Contributors

[![yaquawa](https://avatars.githubusercontent.com/u/13927101?v=4)](https://github.com/yaquawa "yaquawa (18 commits)")[![thanasisxan](https://avatars.githubusercontent.com/u/36565555?v=4)](https://github.com/thanasisxan "thanasisxan (4 commits)")

---

Tags

frameworklaravelwordpress

### Embed Badge

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

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

###  Alternatives

[rebing/graphql-laravel

Laravel wrapper for PHP GraphQL

2.2k7.1M26](/packages/rebing-graphql-laravel)[wpstarter/framework

The WpStarter Framework - Laravel Framework for WordPress

1810.1k4](/packages/wpstarter-framework)

PHPackages © 2026

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