unifreak / rememberable-db
Laravel 5 数据库查询缓存
v1.0.1
2018-09-25 09:14 UTC
Requires
- watson/rememberable: ^2.0
This package is auto-updated.
Last update: 2024-09-25 22:22:57 UTC
README
RememberableDB
从 https://github.com/dwightwatson/rememberable 继承,为 DB
添加了缓存能力(使用外观 RDB
)。
安装
-
安装 composer 包:运行
composer require unifreak/rememberable-db
-
注册服务提供者:打开
config/app.php
,将以下行添加到providers
配置项中UniFreak\RememberableDB\RDBServiceProvider::class,
-
注册外观:打开
config/app.php
,将以下行添加到aliases
配置项中'RDB' => UniFreak\RememberableDB\RDBFacade::class,
-
完成
使用
// first, import RDB facade use RDB // you need to call table() first, then you can use the caching functions // see <https://github.com/dwightwatson/rememberable> RDB::table()->remember()....