Skip to content

devituz/laravel-cachable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Laravel Cachable

LaravelCachable is a simplified, multi-language model caching trait that works with Redis. It automatically caches and purges model data on created, updated, and deleted events.


๐Ÿ“ฆ Installation

composer require devituz/laravel-cachable

Add model

use Cachable;

Example code

$product = Product::find(1);

// ๐Ÿ”น Save single record to cache
$product->cacheSingle();

// ๐Ÿ”น Retrieve single record from cache
$cached = Product::getCached(1);

// ๐Ÿ”น Retrieve all records from cache
$all = Product::allCached();

// ๐Ÿ”น Clear cache for a record
$product->forgetCache();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages