PHPackages                             angejia/pea - 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. [Caching](/categories/caching)
4. /
5. angejia/pea

ActiveLibrary[Caching](/categories/caching)

angejia/pea
===========

Eloquent Cache Layer

v0.0.20(10y ago)832.5k21[4 issues](https://github.com/angejia/pea/issues)[1 PRs](https://github.com/angejia/pea/pulls)MITPHP

Since Dec 8Pushed 8y ago9 watchersCompare

[ Source](https://github.com/angejia/pea)[ Packagist](https://packagist.org/packages/angejia/pea)[ RSS](/packages/angejia-pea/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (21)Used By (0)

pea
===

[](#pea)

[![Join the chat at https://gitter.im/angejia/pea](https://camo.githubusercontent.com/0c9b765a205be0498829867e45959bd61880afd5e6826ab4a181512e51949eb5/68747470733a2f2f6261646765732e6769747465722e696d2f616e67656a69612f7065612e737667)](https://gitter.im/angejia/pea?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Build Status](https://camo.githubusercontent.com/0e98e68dca7f747cc1653f266d15ef5ea11d29d9b74f6efdc75aca399aa45bad/68747470733a2f2f7472617669732d63692e6f72672f616e67656a69612f7065612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/angejia/pea)

Laravel Eloquent 的缓存层。

特色
--

[](#特色)

- 行级缓存
- 表级缓存
- 自动过期

更多细节参考[wiki](../../wiki)。

安装
--

[](#安装)

```
composer require angejia/pea:dev-master

```

使用
--

[](#使用)

在`config/app.php`中添加`Angejia\Pea\ServiceProvider`，然后使用`Angejia\Pea\Model`替换`Illuminate\Database\Eloquent\Model`。 最后在模型中设置`protected`属性`$needCache`为`true`即可开启缓存支持。

```
class UserModel extends \Angejia\Pea\Model
{
    protected $needCache = true;
}
```

如果你有专门的 Redis 缓存实例，可以通过`config/database.php`指定。具体参见[wiki](../../wiki/Laravel-%E9%85%8D%E7%BD%AE)。

---

[安个家](http://www.angejia.com/)出品。

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 98.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 ~4 days

Recently: every ~14 days

Total

20

Last Release

3720d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9fafed7714677f6e4d832236fde74c0f0fd40d4cdd37b05f2b12792553713238?d=identicon)[angejia](/maintainers/angejia)

---

Top Contributors

[![taoso](https://avatars.githubusercontent.com/u/2030591?v=4)](https://github.com/taoso "taoso (53 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/angejia-pea/health.svg)

```
[![Health](https://phpackages.com/badges/angejia-pea/health.svg)](https://phpackages.com/packages/angejia-pea)
```

###  Alternatives

[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

2.4k4.8M26](/packages/genealabs-laravel-model-caching)[mikebronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k127.1k1](/packages/mikebronner-laravel-model-caching)[laragear/cache-query

Remember your query results using only one method. Yes, only one.

272122.8k](/packages/laragear-cache-query)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k2.0k](/packages/mike-bronner-laravel-model-caching)[monospice/laravel-redis-sentinel-drivers

Redis Sentinel integration for Laravel and Lumen.

103830.5k](/packages/monospice-laravel-redis-sentinel-drivers)[namoshek/laravel-redis-sentinel

An extension of Laravels Redis driver which supports connecting to a Redis master through Redis Sentinel.

38679.0k](/packages/namoshek-laravel-redis-sentinel)

PHPackages © 2026

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