riste/repository
Composer 安装命令:
composer require riste/repository
包简介
Allow you to easily cache laravel models and retrieve from laravel's cache by extending AbstractRepository
README 文档
README
INSTALLATION: composer require riste/repository:dev-main
Caching models, example:
class UserRepository extends AbstractRepository { private string $key = "_users"; public function getKey():string { return $this->key; } public function setKey(string $key):void { $this->$key = $key; } }
Finally, if i want to save/update my current user eloquent model i will call:
$userRepo = new UserRepository(); $userModel = User::find(1); $userRepo->addOrUpdate($userModel, 1); // where second parameter is TTL cache in hours
// If i need to search trough cache i will call findMany method $userRepo->findMany(["name" => "Riste"]); // Will look through cache where column is name and value Riste in case insensitive and will return array items of eloquent models that matches name Riste.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-06-19