zgabievi/kendo-grid-state

Laravel 中处理 Kendo Grid 状态的辅助包

0.1.0 2018-08-13 06:36 UTC

This package is auto-updated.

Last update: 2024-08-29 03:52:58 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

你喜欢在网站上使用 Kendo Grid 吗?你曾经尝试管理其状态以返回正确数据吗?有了这个包的帮助,现在只需要几秒钟。你只需要安装我们的助手,并告诉我们它应该在哪个模型上工作... 完成!

安装

通过 composer 安装

composer require zgabievi/kendo-grid-state

用法

要使用此包,你只需要将 Filterable 特性添加到你的模型中

示例

 namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 use Zgabievi\KendoGridState\Traits\Filterable;
 
 class Post extends Model
 {
     use Filterable;
     
     //
 }

URL 示例

  • https://domain.com/api/posts?take=5
  • https://domain.com/api/posts?skip=5&take=2
  • https://domain.com/api/posts?sort[0][field]=title&sort[0][dir]=desc
  • https://domain.com/api/posts?filter[logic]=and&filter[filters][0][field]=title&filter[filters][0][operator]=eq&filter[filters][0][value]=POST_TITLE

查询参数

  • filter?
    • filters[]
      • field? (字符串 | 函数)
      • ignoreCase? (布尔值)
      • operator ("eq", "neq", "isnull", "isnotnull", "lt", "lte", "gt", "gte", "startswith", "endswith", "contains", "doesnotcontain", "isempty", "isnotempty")
      • value? (任何)
    • logic ("or", "and")
  • group?[]
    • aggregates?[]
      • aggregate ("count", "sum", "average", "min", "max")
      • field (字符串)
    • dir? ("asc", "desc")
    • field (字符串)
  • skip? (数字)
  • sort?
    • dir? ("asc", "desc")
    • field (字符串)
  • take? (数字)

测试

composer test

变更日志

请参阅 CHANGELOG 了解最近更改的详细信息。

贡献

请参阅 CONTRIBUTING 了解详细信息。

安全

如果你发现任何与安全相关的问题,请通过电子邮件 zura.gabievi@gmail.com 而不是使用问题跟踪器来报告。

鸣谢

许可证

MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件