rinvex / laravel-cacheable
Rinvex Cacheable is a granular, intuitive, and fluent caching system for eloquent models. Simple, but yet powerful, plug-n-play with no hassle.
Installs: 123 400
Dependents: 4
Suggesters: 0
Security: 0
Stars: 112
Watchers: 2
Forks: 22
Open Issues: 0
Requires
- php: ^7.4.0 || ^8.0.0
- illuminate/cache: ^8.0.0 || ^9.0.0
- illuminate/contracts: ^8.0.0 || ^9.0.0
- illuminate/database: ^8.0.0 || ^9.0.0
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.30.0
- illuminate/container: ^8.0.0 || ^9.0.0
- phpunit/phpunit: ^9.5.0
README
⚠️ This package is abandoned and no longer maintained. No replacement package was suggested. ⚠️
👉 If you are interested to step on as the main maintainer of this package, please reach out to me!
Rinvex 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?
Installation & Usage
-
Install the package via composer:
composer require rinvex/laravel-cacheable
-
Use the
\Rinvex\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.
Optional Features
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;
Changelog
Refer to the Changelog for a full history of the project.
Support
The following support channels are available at your fingertips:
Contributing & Protocols
Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md.
Bug reports, feature requests, and pull requests are very welcome.
Security Vulnerabilities
If you discover a security vulnerability within this project, please send an e-mail to help@rinvex.com. All security vulnerabilities will be promptly addressed.
About Rinvex
Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.
License
This software is released under The MIT License (MIT).
(c) 2016-2021 Rinvex LLC, Some rights reserved.