PHP code example of alkhatibdev / inertia-pagination

1. Go to this page and download the library: Download alkhatibdev/inertia-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/ */

    

alkhatibdev / inertia-pagination example snippets


// App\Http\Controllers\PostController

public function index() 
{
    return Inertia::render('Post/Index', [
        'posts' => Post::select([
            "id", "title", "description"
        ])->paginate(10),
    ]);
}
shell
php artisan vendor:publish --tag=inertia-pagination