jord-jd/laravel-natural-where
最新稳定版本:v3.0.0
Composer 安装命令:
composer require jord-jd/laravel-natural-where
包简介
Laravel Natural Where extends the Laravel query builder to allow expressing of where operators in natural language.
README 文档
README
Laravel Natural Where extends the Laravel query builder to allow expressing of where operators in natural language.
Installation
To install Laravel Natural Where, run the following command from the root of your project.
composer require jord-jd/laravel-natural-where
Usage
See the basic usage example below.
$query = \App\User::query() ->naturalWhere('created_at', 'is between the years', ['2018', '2020']) ->naturalWhere('email', 'contains the word', 'jordan') ->naturalWhere('name', 'is not', 'Jordan Smith') ->naturalWhere('id', 'is one of the following', [1, 2, 3]) ->get();
This example will produce the following SQL query.
select * from `users` where (`created_at` >= '2018' and `created_at` <= '2020') and `email` LIKE '%jordan%' and `name` != 'Jordan Smith' and `id` in (1, 2, 3)
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-only
- 更新时间: 2026-02-14