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[5 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 today

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 83% 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

3670d 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

[monospice/laravel-redis-sentinel-drivers

Redis Sentinel integration for Laravel and Lumen.

103826.2k](/packages/monospice-laravel-redis-sentinel-drivers)[vetruvet/laravel-phpredis

Use phpredis as the redis connection in Laravel

45122.8k](/packages/vetruvet-laravel-phpredis)[yangusik/laravel-balanced-queue

Laravel queue management with load balancing between partitions (user groups)

692.6k](/packages/yangusik-laravel-balanced-queue)[laravie/cabinet

Runtime Cache for Laravel Eloquent

1212.5k](/packages/laravie-cabinet)[brekitomasson/laravel-tagged-cache

A wrapper around the cache implementation to reduce complexity regarding caching in your Models

191.5k](/packages/brekitomasson-laravel-tagged-cache)

PHPackages © 2026

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