PHP code example of baldcat / platform-per-page

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

    

baldcat / platform-per-page example snippets




namespace App\Orchid\Layouts;

use Orchid\Screen\Layouts\Table;
use Orchid\Screen\TD;

class ExampleTable extends Table
{
    protected $target = 'tests';

    protected $template = 'platform-pp::layouts.table';
    
    protected function columns(): iterable
    {
        return [
            TD::make('id', 'ID'),
        ];
    }
}


    public function query(): iterable
    {
        return [
            'tests' => Test::ppp(),
        ];
    }



return [
    /**
     * Pagination Options
     *
     * Specifies the available items per page for pagination.
     * Example values:
     * - 10: 10 items per page
     * - 25: 25 items per page
     * - 50: 50 items per page
     */
    'options' => [10, 25, 50],

    /**
     * Pagination Label
     *
     * The label displayed next to the pagination control.
     * Example: "Items Per Page".
     */
    'label' => 'Per Page',
];
bash
php artisan vendor:publish --provider="Baldcat\PlatformPerPage\PlatformPerPageServiceProvider" --tag="config"