PHPackages                             sunaloe/cache - 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. sunaloe/cache

ActiveLibrary[Caching](/categories/caching)

sunaloe/cache
=============

1.0.5(6y ago)013MITPHPPHP ^7.1.3

Since May 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/aloeproject/sunaloe-cache)[ Packagist](https://packagist.org/packages/sunaloe/cache)[ RSS](/packages/sunaloe-cache/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (7)Used By (0)

概述
--

[](#概述)

laravel 自带的缓存是存在string类型，本扩展包保存到hash类型

运行环境
----

[](#运行环境)

- PHP 7.0
- laravel 5.7
- lumen 5.7

安装方法
----

[](#安装方法)

composer require sunaloe/cache

### lumen

[](#lumen)

- 添加门面方法

```
$app->withFacades(true, [
    \Sunaloe\Cache\Facades\SunaloeCache::class => 'SunaloeCache',
]);
```

- 配置引入 把 sunaloe/cache/config/sunaloe-cache.php 拷贝放到配置目录

```
    $app->configure('sunaloe-cache');
```

- 服务提供者引入

```
    $app->register(\Illuminate\Redis\RedisServiceProvider::class);
   $app->register(\Sunaloe\Cache\CacheServiceProvider::class);
```

使用
--

[](#使用)

```
# == hset hk k4 a
\Sunaloe\Cache\Facades\SunaloeCache::setHkeyPrefix("hk")->forever("k4", "a");

# 如果hash 中hk键k2 不存在 则使用 回调函数的值进行设置
\Sunaloe\Cache\Facades\SunaloeCache::setHkeyPrefix("hk")->remember("k2", 100, function () {
            return ['a' => 1];
  });

# 所有hash key 进行删除
\Sunaloe\Cache\Facades\SunaloeCache::flush()
```

License
-------

[](#license)

- MIT

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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 ~0 days

Total

6

Last Release

2238d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8662167?v=4)[Sun aloe](/maintainers/aloeproject)[@aloeproject](https://github.com/aloeproject)

---

Tags

cachelaravellumen

### Embed Badge

![Health badge](/badges/sunaloe-cache/health.svg)

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

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.0M69](/packages/spatie-laravel-responsecache)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.0k1](/packages/mike-bronner-laravel-model-caching)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21111.6k](/packages/iazaran-smart-cache)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)

PHPackages © 2026

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