PHPackages                             don47/database-cache-driver - 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. [Database &amp; ORM](/categories/database)
4. /
5. don47/database-cache-driver

AbandonedArchivedPackage[Database &amp; ORM](/categories/database)

don47/database-cache-driver
===========================

Database Cache Driver for Modulus

0.1.1(6y ago)33MITPHP

Since Nov 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/donaldp/database-cache-driver)[ Packagist](https://packagist.org/packages/don47/database-cache-driver)[ RSS](/packages/don47-database-cache-driver/feed)WikiDiscussions master Synced 5d ago

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

Database Cache Driver for Modulus
=================================

[](#database-cache-driver-for-modulus)

This package enables your database connection(s) as `cache` drivers.

Install
-------

[](#install)

Require the package with composer:

```
composer require don47/database-cache-driver

```

Install the package:

```
php craftsman plugin:install --class="\Don47\DatabaseCacheDriver\CachePlugin"

```

Register the plugin in the app config file:

```
'plugins' => [
  Don47\DatabaseCacheDriver\CachePlugin::class,
  ...
],
```

Append a new "fallback" `cache` connection in your cache config file:

```
'connections' => [
  'fallback' => [
    'driver' => 'database',
    'connection' => 'mysql'
  ],
  ...
],
```

Then run your migrations:

```
php craftsman migrate all

```

Change the default `cache` to `fallback` in the `.env`:

```
HIBERNATE_CACHE=fallback
```

> Note: You can use any database connection. To get started, change the `connection` in the `fallback` config, then add `protected $connection = 'connection_name';` in the `_don47_database_cache_driver` migration. Make sure this is done before running `php craftsman migrate all`.

#### Methods

[](#methods)

Here are some methods to help you get started.

NameHelper MethodArgumentsReturnDescription`Cache::set()``cache($key, $value, $expiration)``string $key, mixed $value, ?Carbon $expiration``bool`Set or overwrite cache`Cache::forever()``cache($key, $value)``string $key, mixed $value``bool`Cache forever`Cache::get()``cache($key)``string $key``mixed`Get cached key`Cache::has()``string $key``bool`Check if item is cached`Cache::forget()``string $key``bool`Remove cached item`Cache::pull()``string $key``mixed`Remove cached itemSecurity
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity49

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

2

Last Release

2386d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6256291?v=4)[Donald Pakkies](/maintainers/Donaldp)[@donaldp](https://github.com/donaldp)

---

Tags

databasecachedrivermodulus

### Embed Badge

![Health badge](/badges/don47-database-cache-driver/health.svg)

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

###  Alternatives

[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[vectorial1024/laravel-cache-evict

Efficiently remove expired Laravel file/database cache data

5813.2k](/packages/vectorial1024-laravel-cache-evict)[chillerlan/php-database

An extensible database wrapper and query builder.

431.2k2](/packages/chillerlan-php-database)

PHPackages © 2026

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