PHPackages                             kargnas/alternative-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. kargnas/alternative-laravel-cache

ActiveLibrary[Caching](/categories/caching)

kargnas/alternative-laravel-cache
=================================

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

0.1(9y ago)14.7k1MITPHPPHP &gt;=5.6

Since Jan 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/kargnas/alternative-laravel-cache)[ Packagist](https://packagist.org/packages/kargnas/alternative-laravel-cache)[ RSS](/packages/kargnas-alternative-laravel-cache/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

\#What is this? This is full-featured replacement for Laravel's Redis and file cache storages. All storages support proper tagging. Cache pools provided by  + I've added `HierarchialFilesystemCachePool` based on code of `FilesystemCachePool` provided by . All classes in this lib only proxies between Laravel's cache system and cache pools from  and my own pools.

\##What is proper tagging? For example you have:

```
Cache::tags(['tag1', 'tag2'])->put('tag-test1', 'ok', 20);

```

How Laravel's native cache works with tags and Redis (Laravel 5.2):

```
Cache::tags(['tag1', 'tag2'])->get('tag-test1');    //< 'ok'
Cache::tags(['tag2', 'tag1'])->get('tag-test1');    //< null
Cache::tags(['tag1'])->get('tag-test1');            //< null
Cache::tags(['tag2'])->get('tag-test1');            //< null
Cache::get('tag-test1');                            //< null
Cache::forget('tag-test1');                         //< won't delete anything
Cache::tags(['tag1', 'tag2'])->forget('tag-test1'); //< deleted
Cache::tags(['tag2', 'tag1'])->forget('tag-test1'); //< won't delete anything
Cache::tags(['tag1'])->forget('tag-test1');         //< won't delete anything
Cache::tags(['tag2'])->forget('tag-test1');         //< won't delete anything
Cache::tags(['tag1'])->flush();                     //< won't delete anything
Cache::tags(['tag2'])->flush();                     //< won't delete anything
Cache::tags(['tag1', 'tag2'])->flush();             //< flushed
Cache::tags(['tag2', 'tag1'])->flush();             //< won't delete anything

```

If you think that this is correct behavior - go away, you don't need this lib.

How it works with this lib:

```
Cache::tags(['tag1', 'tag2'])->get('tag-test1');    //< 'ok' - use Cache::get('tag-test1') instead
Cache::tags(['tag2', 'tag1'])->get('tag-test1');    //< 'ok' - use Cache::get('tag-test1') instead
Cache::tags(['tag1'])->get('tag-test1');            //< 'ok' - use Cache::get('tag-test1') instead
Cache::tags(['tag2'])->get('tag-test1');            //< 'ok' - use Cache::get('tag-test1') instead
Cache::get('tag-test1');                            //< 'ok'
Cache::forget('tag-test1');                         //< deleted
Cache::tags(['tag1', 'tag2'])->forget('tag-test1'); //< deleted - use Cache::forget('tag-test1') instead
Cache::tags(['tag2', 'tag1'])->forget('tag-test1'); //< deleted - use Cache::forget('tag-test1') instead
Cache::tags(['tag1'])->forget('tag-test1');         //< deleted - use Cache::forget('tag-test1') instead
Cache::tags(['tag2'])->forget('tag-test1');         //< deleted - use Cache::forget('tag-test1') instead
Cache::tags(['tag1'])->flush();                     //< deleted all cache entries with tag 'tag1'
Cache::tags(['tag2'])->flush();                     //< deleted all cache entries with tag 'tag2'
Cache::tags(['tag1', 'tag2'])->flush();             //< deleted all cache entries with tag 'tag1' or 'tag2'
Cache::tags(['tag2', 'tag1'])->flush();             //< deleted all cache entries with tag 'tag2' or 'tag1'

```

\##How to use it:

Add to `composer.json`:

```
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/swayok/alternativelaravelcache.git"
    }
],
"require": {
    "swayok/alternativelaravelcache": "master@dev"
}

```

Add to `config/app.php`:

```
$providers = [
    \AlternativeLaravelCache\Provider\AlternativeCacheStoresServiceProvider::class,
]

```

\##Notes By default service provider will replace Laravel's `redis` and `file` cache stores. You can alter this behavior like this:

```
class MyAlternativeCacheStoresServiceProvider extends AlternativeCacheStoresServiceProvider {
    static protected $redisDriverName = 'altredis';
    static protected $fileDriverName = 'altfile';
}

```

File cache storage currently supports only `'driver' => 'file'`. You can extend list of file cache drivers by
overwriting `AlternativeCacheStoresServiceProvider->makeFileCacheAdapter()`

Yep, there is no tests right now and possibly they will never appear.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3397d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/728581edd89f77fbc41079c56d8942d3154c9cf9b8747a60bfb9b65825902f88?d=identicon)[kargnas](/maintainers/kargnas)

---

Tags

phplaravelcacheredis-cachetagged cacheredis tagged cache

### Embed Badge

![Health badge](/badges/kargnas-alternative-laravel-cache/health.svg)

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

###  Alternatives

[swayok/alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

202541.1k6](/packages/swayok-alternative-laravel-cache)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[alexmg86/laravel-sub-query

Laravel subquery

7538.4k](/packages/alexmg86-laravel-sub-query)[byerikas/cache-tags

Allows for Redis/Valkey cache flushing multiple tagged items by a single tag.

1413.9k](/packages/byerikas-cache-tags)[antennaio/laravel-clyde

Image uploads and manipulation for Laravel, a wrapper around Glide

292.6k](/packages/antennaio-laravel-clyde)

PHPackages © 2026

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