PHP code example of tiagof2 / materializecss-laravel-pagination

1. Go to this page and download the library: Download tiagof2/materializecss-laravel-pagination 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/ */

    

tiagof2 / materializecss-laravel-pagination example snippets


//MyController.php
$contacts = Agenda::paginate(10);

return view('agenda.index', [
    'contacts' => $contacts,
]);

// agenda/index.blade.php
{!! with(new TiagoF2\MaterializePagination\MaterializePagination($contacts))->render() !!}

// With custom color
{!! with(new TiagoF2\MaterializePagination\MaterializePagination($contacts))->setColor('indigo lighten-2')->render() !!}