PHPackages                             dv0vd/laravel-redis-stale-refs-cleaner - 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. [CLI &amp; Console](/categories/cli)
4. /
5. dv0vd/laravel-redis-stale-refs-cleaner

ActiveLibrary[CLI &amp; Console](/categories/cli)

dv0vd/laravel-redis-stale-refs-cleaner
======================================

Laravel console command to purge stale Redis cache references

1.0.0(5mo ago)01MITPHPPHP &gt;=7.4

Since Nov 27Pushed 2mo agoCompare

[ Source](https://github.com/dv0vd/laravel-redis-stale-refs-cleaner)[ Packagist](https://packagist.org/packages/dv0vd/laravel-redis-stale-refs-cleaner)[ Docs](https://github.com/dv0vd/laravel-redis-stale-refs-cleaner)[ RSS](/packages/dv0vd-laravel-redis-stale-refs-cleaner/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Laravel Redis Stale References Cleaner
======================================

[](#laravel-redis-stale-references-cleaner)

A lightweight Laravel console command that helps you keep your Redis cache clean and efficient by purging stale (broken) cache references.

In Laravel 6–8, there was no built-in way to safely clean up Redis sets containing references to keys that no longer exist. Laravel 9 introduced a helper command (`php artisan cache:prune-stale-tags`), but older versions require a custom solution — this package fills that gap.

Why This Package Exists
-----------------------

[](#why-this-package-exists)

When using Redis to store reference sets (e.g., `standard_ref` for temporary caches or `forever_ref` for permanent caches), over time some referenced keys may expire or be deleted. This can lead to stale references, which in turn can cause:

- Wasted memory in Redis
- Inaccurate cache statistics
- Unexpected behavior when iterating over cache sets

Without a safe cleanup process, these stale references accumulate, slowly “clogging” your cache and potentially affecting application performance.

This command automates the cleanup, safely removing references to keys that no longer exist, keeping your Redis cache tidy and efficient.

Features
--------

[](#features)

- Safe purging of stale cache references from Redis sets
- Works with both phpredis (`ext-redis`) and `predis/predis` clients
- Fully compatible with **Laravel 6+**
- Chunked processing for large sets to avoid memory issues
- Logs progress and provides a summary of purged keys
- Easy to run via Artisan console

Installation
------------

[](#installation)

```
composer require dv0vd/laravel-redis-stale-refs-cleaner
```

Usage
-----

[](#usage)

1. Run the command:

```
php artisan redis:purge-stale-refs
```

2. Sit back, relax, and enjoy your clean Redis!

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance78

Regular maintenance activity

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Unknown

Total

1

Last Release

166d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/491267c3bba6593625e74fe9908a3316eb5b7af6ef967c45638668d7a67188bd?d=identicon)[dv0vd](/maintainers/dv0vd)

---

Tags

phpconsolelaravelartisanlaravel-packagerediscachecommandpurgecleanupreferencesstalerefscache-clean

### Embed Badge

![Health badge](/badges/dv0vd-laravel-redis-stale-refs-cleaner/health.svg)

```
[![Health](https://phpackages.com/badges/dv0vd-laravel-redis-stale-refs-cleaner/health.svg)](https://phpackages.com/packages/dv0vd-laravel-redis-stale-refs-cleaner)
```

###  Alternatives

[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[nunomaduro/laravel-console-summary

A Beautiful Laravel Console Summary for your Laravel/Laravel Zero commands.

662.0M3](/packages/nunomaduro-laravel-console-summary)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16255.4k7](/packages/nunomaduro-laravel-console-dusk)[rahul900day/laravel-console-spinner

Laravel Console Spinner is a spinner output for Laravel command line.

76125.4k1](/packages/rahul900day-laravel-console-spinner)[ymigval/laravel-model-cache

Laravel package for caching Eloquent model queries

7642.2k3](/packages/ymigval-laravel-model-cache)

PHPackages © 2026

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