PHPackages                             joshbrw/laravel-pagination-specification - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. joshbrw/laravel-pagination-specification

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

joshbrw/laravel-pagination-specification
========================================

A package for consistent pagination in Laravel.

v0.1.9(8y ago)13.0kMITPHPPHP ^7

Since Jun 9Pushed 8y agoCompare

[ Source](https://github.com/joshbrw/laravel-pagination-specification)[ Packagist](https://packagist.org/packages/joshbrw/laravel-pagination-specification)[ RSS](/packages/joshbrw-laravel-pagination-specification/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (10)Used By (0)

Laravel Pagination Specification
================================

[](#laravel-pagination-specification)

The main purpose of this package is to provide a consistent object that represents all of the main values you have to take into account when paginating (i.e. Current Page, Per Page, Appends for the URLs).

This object can then be passed around to methods and used for less verbose method parameters.

Installing
==========

[](#installing)

1. `composer require joshbrw/laravel-pagination-specification`
2. Add the following Service Provider to your `config/app.php` under `provider`: ```
       Joshbrw\PaginationSpecification\PaginationSpecificationServiceProvider::class
    ```
3. Optionally publish the config and change the default Per Page; ```
    php artisan vendor:publish --provider="Joshbrw\PaginationSpecification\PaginationSpecificationServiceProvider"
    ```

Usage
=====

[](#usage)

The class is bound into the container under the `Joshbrw\PaginationSpecification\PaginationSpecification` interface, and can be overwritten/decorated if required.

For example, injecting into a Controller method:

```
