ryuske/redismodel
Composer 安装命令:
composer require ryuske/redismodel
包简介
Use Redis as a primary data store.
README 文档
README
A Model accessor that makes using Redis as a primary data store easy.
Install
Via Composer
$ composer require Ryuske/RedisModel
Usage
/** * Available Methods: * get($id, $fields='all') * * searchBy($data, $fields='all'); * searchByWildcard($data, $fields='all'); * * update($id) * save() * * delete($id) * delete() */ class Account extends Ryuske\Redis\Model { /** * These are fields that are searchable. * The order of this list matters! * Add additional indexes to the bottom * * @var array */ protected $indexes = [ 'id', 'email' ]; /** * These are additional, non-searchable indexes. * The order of this list doesn't matter. * * @var array */ protected $fields = [ 'name', 'password' ]; } class MyController { /** * @var Account */ protected $account; public function __construct(Account $account) { $this->account = $account; } public function showAccount($id) { $account = $this->account->get($id); return view('account.show', [ 'account' => $account ]); } }
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email kenyon.jh@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 83
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-03