art-es / laravel-pagination-buttons
Package for getting pagination buttons from laravel framework
1.0.0
2019-08-19 08:44 UTC
Requires
- php: >=7.1
- laravel/framework: ^5.7
Requires (Dev)
- phpunit/phpunit: 7.*
This package is not auto-updated.
Last update: 2025-03-26 10:33:35 UTC
README
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.