Looking to hire Laravel developers? Try LaraJobs

laravel-pagination-buttons maintained by art-es

Description
Package for getting pagination buttons from laravel framework
Last update
2019/08/19 10:46 (dev-master)
License
Links
Downloads
1

Comments
comments powered by Disqus

Laravel Pagination Buttons

Installation

composer require art-es/laravel-pagination-buttons

Usage

Get pagination buttons.

$buttons = \Artes\Pagination\Pagination::execute($pages, $currentPage);

currentPage is not required argument, default getting param page from Request.

Callback is \Illuminate\Support\Collection object.
It is foreachable object.

You can use

@foreach ($buttons as $button)
    <a href="{{ route('some.route', ['page' => $button->page]) }}"
        class="{{ $button->active ? 'active' : '' }}">
        {{ $button->label }}
    </a>
@endforeach

License

The MIT License (MIT). Please see License File for more information.