riste/repository 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-06-19