PHPackages                             w7/rangine-cache-model - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. w7/rangine-cache-model

ActiveLibrary

w7/rangine-cache-model
======================

对Model扩展缓存支持

v2.1.0(5y ago)03.8kApache-2.0PHPCI failing

Since Mar 7Pushed 4y ago2 watchersCompare

[ Source](https://github.com/we7coreteam/w7-rangine-cache-model)[ Packagist](https://packagist.org/packages/w7/rangine-cache-model)[ RSS](/packages/w7-rangine-cache-model/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (16)Used By (0)

w7Laravel
=========

[](#w7laravel)

#### 使用说明

[](#使用说明)

### 1. 注册 `Psr\SimpleCache\CacheInterface` 实现

[](#1-注册-psrsimplecachecacheinterface-实现)

```
\W7\Laravel\CacheModel\Caches\Cache::setCacheResolver(Cache::store());

```

### 2. 继承 `W7\Laravel\CacheModel\Model`

[](#2-继承-w7laravelcachemodelmodel)

```
use W7\Laravel\CacheModel\Model;

class Member extends Model
{
	public $timestamps = false;

	protected $table = 'members';

	protected $primaryKey = 'uid';

    // 此行可缺省
	protected $useCache = true;
}

```

### 3. 使用

[](#3-使用)

#### find($id)

[](#findid)

```
$uid  = 1;
$user = Member::query()->find($uid);
$user = Member::query()->find($uid);

// query once
// select * from `ims_members` where `ims_members`.`uid` = ? limit 1

```

#### find($ids)

[](#findids)

仅限指定 id 查询，不限定返回列。

```
$uids = [1, 2, 5];
Member::query()->find($uids);
Member::query()->find($uids);

// query once
// select * from `ims_members` where `ims_members`.`uid` in (?, ?, ?)

```

#### $model-&gt;save();

[](#model-save)

删除缓存。

```
$member = Member::find($uid)
$member->invite_code = rand(1, 100000);
$member->save();

```

#### $model-&gt;update();

[](#model-update)

删除缓存

#### $model-&gt;delete();

[](#model-delete)

删除缓存

#### Member::flush();

[](#memberflush)

清空指定表的缓存

#### Cache::flush();

[](#cacheflush)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 56.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~57 days

Recently: every ~97 days

Total

11

Last Release

1965d ago

Major Versions

v1.0.2 → v2.0.02019-10-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/67366373461d229a38d9b2f4b9f5fe6bd87a1c9bb74fedcf45d089f3ec90268d?d=identicon)[donknap@gmail.com](/maintainers/donknap@gmail.com)

---

Top Contributors

[![titrxw](https://avatars.githubusercontent.com/u/19631469?v=4)](https://github.com/titrxw "titrxw (32 commits)")[![gordensong](https://avatars.githubusercontent.com/u/7833600?v=4)](https://github.com/gordensong "gordensong (19 commits)")[![fykyx521](https://avatars.githubusercontent.com/u/3068711?v=4)](https://github.com/fykyx521 "fykyx521 (4 commits)")[![donknap](https://avatars.githubusercontent.com/u/4213382?v=4)](https://github.com/donknap "donknap (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/w7-rangine-cache-model/health.svg)

```
[![Health](https://phpackages.com/badges/w7-rangine-cache-model/health.svg)](https://phpackages.com/packages/w7-rangine-cache-model)
```

###  Alternatives

[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
