sukohi/json-where
最新稳定版本:2.0.0
Composer 安装命令:
composer require sukohi/json-where
包简介
README 文档
README
A PHP package mainly developed for Laravel to easily set where clause for JSON.
(This is for Laravel 5+. For Laravel 4.2)
Installation
Add this package name in composer.json
"require": {
"sukohi/json-where": "2.*"
}
Execute composer command.
composer update
Register the service provider in app.php
'providers' => [
...Others...,
Sukohi\JsonWhere\JsonWhereServiceProvider::class,
]
Also alias
'aliases' => [
...Others...,
'JsonWhere' => Sukohi\JsonWhere\Facades\JsonWhere::class
]
Usage
$jsons = DB::table('tests')->where(function($query){
\JsonWhere::query($query)
->column('json')
->value(3, $type = 'auto'); // $type: (default: auto), string or int. Optional.
})->get();
or You also can use model like so.
$jsons = \App\Test::where(function($query){
\JsonWhere::query($query)
->column('json')
->value(3, 'int');
})->get();
License
This package is licensed under the MIT License.
Copyright 2015 Sukohi Kuhoh
统计信息
- 总下载量: 36
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-23