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(2mo ago)0125MITPHP

Since Oct 15Pushed 2mo 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 1mo 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

35

—

LowBetter than 79% of packages

Maintenance85

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

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

78d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c2870f3f748dfc68ab3103cae2bbd1bd8cceb2d484be181c2220d397f4e2bb7?d=identicon)[jhdxr](/maintainers/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

[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

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

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[mikebronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k127.1k1](/packages/mikebronner-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)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)

PHPackages © 2026

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