baldcat/platform-per-page
最新稳定版本:0.3.0
Composer 安装命令:
composer require baldcat/platform-per-page
包简介
Adds functionality for selecting the number of records in tables for the Orchid Platform.
README 文档
README
Installation
To install the package, run the following command:
composer require baldcat/platform-per-page
Usage
Connecting the Functionality to the Table
To add the ability to select a number of records to a table, override the $template property as shown below:
<?php 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'), ]; } }
You can use the ppp macros for the query builder to specify the number of records in the query method:
public function query(): iterable { return [ 'tests' => Test::ppp(), ]; }
Configuration
The configuration file contains two options:
<?php 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', ];
To modify these options, publish the configuration file using the command:
php artisan vendor:publish --provider="Baldcat\PlatformPerPage\PlatformPerPageServiceProvider" --tag="config"
统计信息
- 总下载量: 47
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-26