25/11
2015
Wallogit.com
2017 © Pedro Peláez
Eloquent Cache Layer
Laravel Eloquent 的缓存层。, (*2)
更多细节参考wiki。, (*3)
composer require angejia/pea:dev-master
在config/app.php中添加Angejia\Pea\ServiceProvider,然后使用Angejia\Pea\Model替换Illuminate\Database\Eloquent\Model。 最后在模型中设置protected属性$needCache为true即可开启缓存支持。, (*4)
class UserModel extends \Angejia\Pea\Model
{
protected $needCache = true;
}
如果你有专门的 Redis 缓存实例,可以通过config/database.php指定。具体参见wiki。, (*5)
安个家出品。, (*6)