Sormagec Mongo Cacheable is a granular, intuitive, and fluent caching system for eloquent mongodb models. Simple, but yet powerful, plug-n-play with no hassle.
sormagec/laravel-mongo-cacheable is a Laravel package for sormagec mongo cacheable is a granular, intuitive, and fluent caching system for eloquent mongodb models. simple, but yet powerful, plug-n-play with no hassle..
It currently has 0 GitHub stars and 6 downloads on Packagist (latest version v1.0.4).
Install it with composer require sormagec/laravel-mongo-cacheable.
Discover more Laravel packages by sormagec
or browse all Laravel packages to compare alternatives.
Last updated
Sormagec MongoDB Cacheable is a granular, intuitive, and fluent caching system for eloquent models. Simple, but yet powerful, plug-n-play with no hassle.
What this package do -technically- caching eloquent query passing through the get method, whatever it is and it's smart enough to indicated any conditions, limit, offset, wheres, orders, groups, ..etc and take that criteria into account when caching and checking for cached version. Also by default any create, update, or delete event will flush all cache for that specific model. It uses default Laravel caching system, and utilizes whatever cache driver you are using. Awesome, right?
Install the package via composer:
composer require sormagec/laravel-cacheable
Use the \Sormagec\Cacheable\CacheableEloquent in your desired model, and you're done!
Seriously, that's it!
Check the CacheableEloquent source code for more awesome stuff if you need advanced control.
You can optionally override model caching behaviour per model as follows:
/**
* Indicate if the model cache clear is enabled.
*
* @var bool
*/
protected $cacheClearEnabled = true;
/**
* The model cache driver.
*
* @var string
*/
protected $cacheDriver = 'memcached';
/**
* The model cache lifetime.
*
* @var int
*/
protected $cacheLifetime = -1;
This software is released under The MIT License (MIT).
(c) 2016-2019 Rinvex LLC, Some rights reserved.