Download the PHP package ebects/laravel-cache-group without Composer
On this page you can find all versions of the php package ebects/laravel-cache-group. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ebects/laravel-cache-group
More information about ebects/laravel-cache-group
Files in ebects/laravel-cache-group
Package laravel-cache-group
Short Description Group-based cache invalidation for Laravel โ organize cache by groups, invalidate by scope (user/role/custom), with automatic Redis Cluster compatibility.
License MIT
Homepage https://github.com/ebectsali/laravel-cache-group
Informations about the package laravel-cache-group
Laravel Cache Group
Group-based cache invalidation for Laravel โ organize cache by groups, invalidate by scope (user/role/custom), with automatic Redis Cluster compatibility.
Features
- ๐ฆ Cache Groups โ organize cache per feature/module with a dedicated class
- ๐ฏ Scoped Invalidation โ per user, role, tenant, or any custom scope
- ๐ Cascading Dependencies โ invalidate related groups automatically via
also_invalidate - ๐ก๏ธ Redis Cluster Ready โ auto-detect single/cluster mode, zero config
- โก Throttle/Debounce โ protect against invalidation storms
- ๐ Queue Safe โ explicit scope resolution for jobs without auth context
- ๐ Pluggable Auth โ works with Sanctum, JWT, Passport, or any custom auth
- ๐ Artisan Commands โ inspect, validate, and monitor cache groups
- ๐งช Testing Utilities โ FakeCacheManager with assertion helpers
- ๐ CacheGroupStore โ scope-aware
remember()andrememberResource()helpers
Installation
Publish the config (optional):
Quick Start
1. Create a Cache Group
2. Register Cache Groups
In a service provider (e.g. AppServiceProvider):
3. Store Cache with CacheGroupStore (READ side)
4. Invalidate Cache (WRITE side)
5. Implement ScopeResolver
Register in config:
CacheGroupStore API
The READ side โ storing and retrieving cached data with automatic scope handling.
remember() โ HTTP context (auto-resolve scope)
rememberFor() โ Queue/CLI context (explicit scope)
rememberResource() โ Resource/detail cache (scope-aware)
Utility methods
Invalidation API
The WRITE side โ clearing cache when data changes.
Using Trait (recommended)
Using Facade
Force Invalidate with Throttle
Artisan Commands
Redis Cluster Support
The library auto-detects your Redis setup:
| Redis Setup | Strategy | How It Works |
|---|---|---|
| Single Redis | Cache::tags()->flush() |
Fast, precise |
| Redis Cluster | SCAN + DEL per node |
Compatible, safe |
No config needed. To force a mode:
Testing
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
- Redis (single or cluster)
Support
If this package helps you, consider buying me a coffee โ
License
MIT License. See LICENSE for details.
All versions of laravel-cache-group with dependencies
illuminate/cache Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/redis Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0