PHPackages                             jhdxr/laravel-prune-db-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. jhdxr/laravel-prune-db-cache

ActiveLibrary[Caching](/categories/caching)

jhdxr/laravel-prune-db-cache
============================

Clear expired cache items in DB for laravel database driver

v0.0.3(5mo ago)0125MITPHP

Since Oct 15Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/jhdxr/laravel-prune-db-cache)[ Packagist](https://packagist.org/packages/jhdxr/laravel-prune-db-cache)[ RSS](/packages/jhdxr-laravel-prune-db-cache/feed)WikiDiscussions master Synced 1w ago

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

[![Latest Stable Version](https://camo.githubusercontent.com/ff170da9510818af21d3d01af4178c676adfb06d1622f88c898b2f2be2f76312/68747470733a2f2f706f7365722e707567782e6f72672f6a686478722f6c61726176656c2d7072756e652d64622d63616368652f762f737461626c652e737667)](https://packagist.org/packages/jhdxr/laravel-prune-db-cache)[![License](https://camo.githubusercontent.com/56dd0ac57411101a093561690e649fd7140e79a024c184d04f0265d901a619da/68747470733a2f2f706f7365722e707567782e6f72672f6a686478722f6c61726176656c2d7072756e652d64622d63616368652f6c6963656e73652e737667)](https://packagist.org/packages/jhdxr/laravel-prune-db-cache)

Prune Expired Cache For Laravel DB Driver
=========================================

[](#prune-expired-cache-for-laravel-db-driver)

The built-in `database` cache driver in Laravel does not have a built-in way to delete expired cache entries automatically, nor a quick way to clear the expired items only. This package helps you to handle this issue.

This package adds one artisan command: `php artisan cache:db-prune-expired` and it will delete all expired records from the cache table.

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

[](#installation)

You can install the package via composer:

```
composer require jhdxr/laravel-prune-db-cache
```

Usage
-----

[](#usage)

Run the following command

```
php artisan cache:db-prune-expired
```

### Run on schedule

[](#run-on-schedule)

It's very easy to use [Laravel's built-in scheduler](https://laravel.com/docs/11.x/scheduling) to run the command automatically. For example, if you want to run the command every day at 4 AM, you can add the following to your `app/Console/Kernel.php` file:

```
protected function schedule(Schedule $schedule)
{
    $schedule->command('cache:db-prune-expired')->dailyAt('04:00');
}
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

31

—

LowBetter than 65% of packages

Maintenance70

Regular maintenance activity

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

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

Total

3

Last Release

178d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1993373?v=4)[蝦米](/maintainers/jhdxr)[@jhdxr](https://github.com/jhdxr)

---

Top Contributors

[![jhdxr](https://avatars.githubusercontent.com/u/1993373?v=4)](https://github.com/jhdxr "jhdxr (7 commits)")

### Embed Badge

![Health badge](/badges/jhdxr-laravel-prune-db-cache/health.svg)

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

###  Alternatives

[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M328](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)[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.

21114.2k](/packages/iazaran-smart-cache)

PHPackages © 2026

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