PHP code example of art-es / laravel-pagination-buttons

1. Go to this page and download the library: Download art-es/laravel-pagination-buttons library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

art-es / laravel-pagination-buttons example snippets


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