sylarele/http-query-config
查询用于简化配置过滤器、作用域、关系等,以及简化结果分页。
0.0.4
2024-09-23 13:15 UTC
Requires
- php: ^8.3
- illuminate/collections: ^10.0|^11.0
- illuminate/database: ^10.0|^11.0
- illuminate/pagination: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
- illuminate/validation: ^10.0|^11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.59
- orchestra/testbench: ^9.2
- phpstan/phpstan: ^1.11
- rector/rector: ^1.2
- shipmonk/composer-dependency-analyser: ^1.6
This package is auto-updated.
Last update: 2024-09-23 13:35:22 UTC
README
简介
查询是在域(查询目录)中定义的类。对于每个可查询的模型,都应该有一个查询。查询用于简化配置过滤器、作用域、关系等,以及简化结果分页。
需求
PHP 版本
简单示例
<?php declare(strict_types=1); namespace Domain\Acme\Queries; use Sylarele\HttpQueryConfig\Query\Query; use Sylarele\HttpQueryConfig\Query\QueryConfig; use Sylarele\HttpQueryConfig\Models\MyModel; class FooModelQuery extends Query { protected function model(): string { return FooModel::class; } protected function configure(QueryConfig $config): void { $config->filter('filterName')->type(FilterType::Type); } }