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

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

dees040/pagination
==================

Dynamic pagination for your Eloquent models.

06PHP

Since Mar 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dees040/pagination)[ Packagist](https://packagist.org/packages/dees040/pagination)[ RSS](/packages/dees040-pagination/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Dynamic pagination in Laravel
=============================

[](#dynamic-pagination-in-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/b4ab991cb70adc032e0729bc9ed3ab8229fbd24624e7586e5275c88e965d5ded/68747470733a2f2f706f7365722e707567782e6f72672f646565733034302f706167696e6174696f6e2f762f737461626c65)](https://packagist.org/packages/dees040/pagination)[![Total Downloads](https://camo.githubusercontent.com/35c6a84139ac61be6156f6e9e15e01813288e9b43fe32735c6ca8f5a66203a4b/68747470733a2f2f706f7365722e707567782e6f72672f646565733034302f706167696e6174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/dees040/pagination)[![Build status](https://camo.githubusercontent.com/2a67b1804665927008a577ed9c4798ad67d035c41b25cb2cc5dcbe4fb11ada40/68747470733a2f2f7472617669732d63692e6f72672f646565733034302f706167696e6174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dees040/pagination)

Dynamic pagination for your Eloquent models. Paginate, order and sort with just the query parameters.

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

[](#installation)

Use composer to install the package.

```
composer require dees040/pagination
```

The service provider will automatically by registered using Laravel 5.5 or higher. Otherwise add the following provider to your `providers` array in the `config/app.php`

```
dees040\Pagination\ServiceProvider
```

The package comes with a small config file. To publish the config file run the following command:

```
php artisan vendor:publish --provider="dees040\Pagination\ServiceProvider" --tag="config"
```

Usage
-----

[](#usage)

The package will add a macro (method) to the Eloquent builder automatically when the service provider is registered. You can then use the `dynamicPagination()` method. If you like you can chance the method name in the config.

Example:

```
