PHPackages                             webman-tech/laravel-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. webman-tech/laravel-cache

ActiveLibrary[Caching](/categories/caching)

webman-tech/laravel-cache
=========================

Webman plugin webman-tech/laravel-cache

v12.0.12(5mo ago)31.9k↓33.3%1MITPHPPHP ^8.2

Since Dec 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/webman-tech/laravel-cache)[ Packagist](https://packagist.org/packages/webman-tech/laravel-cache)[ RSS](/packages/webman-tech-laravel-cache/feed)WikiDiscussions 12.x Synced 1mo ago

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

webman-tech/laravel-cache
=========================

[](#webman-techlaravel-cache)

> Split from [webman-tech/laravel-monorepo](https://github.com/webman-tech/laravel-monorepo)

适用于 webman 的 Laravel 缓存组件，基于 illuminate/cache 实现。

安装
--

[](#安装)

```
composer require webman-tech/laravel-cache
```

简介
--

[](#简介)

该组件将 Laravel 强大的缓存功能引入 webman 框架中，使开发者能够使用 Laravel 的缓存 API。

所有方法和配置与 Laravel 几乎一致，因此使用方式可完全参考 [Laravel Cache 文档](https://laravel.com/docs/cache)。

特殊使用说明
------

[](#特殊使用说明)

### 1. Facades 使用方式

[](#1-facades-使用方式)

在 webman 中使用以下 Facades 替代 Laravel 的对应 Facades：

- 使用 `WebmanTech\LaravelCache\Facades\Cache` 替代 `Illuminate\Support\Facades\Cache`
- 使用 `WebmanTech\LaravelCache\Facades\CacheLocker` 处理锁操作
- 使用 `WebmanTech\LaravelCache\Facades\CacheRateLimiter` 替代 `Illuminate\Support\Facades\RateLimiter`

### 2. 命令行支持

[](#2-命令行支持)

组件提供以下命令行工具：

```
# 删除缓存下的某个键
php webman cache:forget key_name

# 清空所有缓存（注意：此方法使用 Cache::flush 来清除）
php webman cache:clear
```

### 3. 扩展支持

[](#3-扩展支持)

在 `config/plugin/webman-tech/laravel-cache/cache.php` 中配置 `extend`：

```
return [
    'extend' => function(\Illuminate\Cache\CacheManager $cache) {
        $cache->extend('mongo', function () use ($cache) {
           return $cache->repository(new MongoStore);
        });
    }
];
```

### 4. PSR 标准支持

[](#4-psr-标准支持)

```
// PSR-16 简单缓存
$psr16 = Cache::psr16();

// PSR-6 缓存池（需要安装 symfony/cache）
$psr6 = Cache::psr6();
```

### 5. 限流中间件

[](#5-限流中间件)

组件实现了适用于 webman 路由的限流中间件：

```
use Webman\Route;
use WebmanTech\LaravelCache\Middleware\ThrottleRequestsFactory;

Route::get('/api/users', [UserController::class, 'index'])
    ->middleware([
        new ThrottleRequestsFactory([
            'limiter_for' => 'api', // 需要在 rate_limiter.php 中配置
        ]),
    ]);
```

注意事项
----

[](#注意事项)

1. `Cache::flush()` 会清空存储器下的所有数据，而非仅当前应用的缓存
2. 可通过配置 `app.flush.prevent = true` 禁止使用 flush 方法
3. 缓存的默认过期时间为永久，需要手动设置过期时间

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance79

Regular maintenance activity

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~56 days

Recently: every ~31 days

Total

22

Last Release

76d ago

Major Versions

v1.2.1 → 11.0.02025-02-08

11.0.0 → 12.0.02025-06-04

11.x-dev → v12.0.32025-07-18

PHP version history (3 changes)v1.0.0PHP &gt;=7.2

v1.2.0PHP &gt;=7.3

11.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4053cfc9956b8c15b9bc4c9c7c2bad625d16d1b6d9191019b2a25cc0972d955?d=identicon)[kriss](/maintainers/kriss)

---

Top Contributors

[![krissss](https://avatars.githubusercontent.com/u/10680903?v=4)](https://github.com/krissss "krissss (22 commits)")

### Embed Badge

![Health badge](/badges/webman-tech-laravel-cache/health.svg)

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

###  Alternatives

[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

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

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

1.7k12.1M99](/packages/laravel-pulse)[mikebronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k127.1k1](/packages/mikebronner-laravel-model-caching)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)

PHPackages © 2026

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