rondigital/query-filter
Composer 安装命令:
composer require rondigital/query-filter
包简介
Filter and search in Laravel Model.
README 文档
README
Filter and search in Laravel Model.
composer require rondigital/query-filter
The QueryFilter is a trait used for filter, multiple filter and search in Laravel Model. You can install it using the composer command mentioned above. To use it in your class, add the following line with the "use" keyword:
use Rondigital\QueryFilter\QueryFilter; class YourClass { use QueryFilter; // ... }
Parameters:
- startingDate : must be Y-M-D H:i:s
- endingDate : must be Y-M-D H:i:s
- filteredBy : must be;
- today
- last-24
- last-7-day
- last-30-day
- last-60-day
- last-90-day
- last-year
- this-month
- last-month
- this-week
- last-week
- search : must be search value
- searchColumn : must be column name
- orderBy : must be column name
- orderType : must be asc/desc
Inside your function, you can use it as follows:
$model = Model::all(); return $this->query($model, $request);
ex:
http://localhost:8000/api/files?search=pdf&searchColumn=extension&filteredBy=today&orderType=asc&orderBy=extension&perPage=1
Response / 200 OK
{
"current_page": 1,
"data": [
{
"id": 6,
"user_id": 23,
"filename": "1686910391_siuqkT7MvLsmvpVH",
"real_filename": "seller-288138-barkod-bazlı-iptal-raporu-2023.05.03-18.17.56.pdf",
"extension": "pdf",
"deleted_at": null,
"created_at": "2023-06-16T10:13:11.000000Z",
"updated_at": "2023-06-16T10:13:11.000000Z"
}
],
"first_page_url": "http://localhost:8008/api/files?page=1",
"from": 1,
"last_page": 3,
"last_page_url": "http://localhost:8008/api/files?page=3",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost:8008/api/files?page=1",
"label": "1",
"active": true
},
{
"url": "http://localhost:8008/api/files?page=2",
"label": "2",
"active": false
},
{
"url": "http://localhost:8008/api/files?page=3",
"label": "3",
"active": false
},
{
"url": "http://localhost:8008/api/files?page=2",
"label": "Next »",
"active": false
}
],
"next_page_url": "http://localhost:8008/api/files?page=2",
"path": "http://localhost:8008/api/files",
"per_page": 1,
"prev_page_url": null,
"to": 1,
"total": 3
}
rondigital/query-filter 适用场景与选型建议
rondigital/query-filter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.17k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 08 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 rondigital/query-filter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rondigital/query-filter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-11