wu/giorgio-filter
最新稳定版本:1.1.1
Composer 安装命令:
composer require wu/giorgio-filter
包简介
laravel query filter
README 文档
README
关于 About Giorgio Filter
为你的 Laravel 应用添加一个简化的查询工具。
Add a simplified query tool to your Laravel application.
预览 Preview
安装 Install
引入扩展
Require
composer require wu/giorgio-filter
在你的 Model 类中使用 Filter
Use Filter in your Model class
use GiorgioFilter\Filters\Filter;
注意事项 Considerations
Filter 只能构建 = 条件的查询语句。如果要自定义复杂条件,请像下边代码示例一样自定义 Filter,最后将自定义 Filter 引入到 Model 中。
Filter can only build query with = conditions. If you want to customize complex conditions, please customize the Filter as shown in the code example below, and then import the customized Filter into the your Model.
示例 example:
<?php namespace App\Models; use GiorgioFilter\Filters\Filter; use Illuminate\Database\Eloquent\Builder; trait UserFilter { use Filter; protected function nameFilter($value): Builder { return $this->builder->where('name', 'like', '%' . $value . '%'); } }
可以使用 php artisan make:filter UserFilter 快速创建自定义 Filter。
You can use php artisan make:filter UserFilter to quickly create a custom filter.
License
The Giorgio Socket is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-22