fugazi-code/laravel-eloquent-filter
最新稳定版本:1.0.2
Composer 安装命令:
composer require fugazi-code/laravel-eloquent-filter
包简介
A custom filter for your Eloquent Builder
README 文档
README
This is where your description should go. Take a look at contributing.md to see a to do list.
Installation
Via Composer
$ composer require fugazi-code/laravel-eloquent-filter
Usage
Change log
Please see the changelog for more information on what has changed recently.
Install
$ php artisan make:filter UserFilter
Filter Class
<?php namespace App\Http\Controllers\Filters; use FugaziCode\Filter\Filter; class UserFilter extends Filter { public function email($value) { $this->query->where('email', 'like', "%$value%"); } public function permanent($value) { $this->query->whereHas('address', function($query) use ($value) { $query->where('permanent', 'like', "%$value%"); }); } }
Eloquent Implementation
Route::get('/', function () { return User::query()->with(['address'])->filter(new UserFilter)->get(); });
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author@email.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-21