PHPackages                             kjmtrue/laravel-cacheable - 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. [Database &amp; ORM](/categories/database)
4. /
5. kjmtrue/laravel-cacheable

ActiveLibrary[Database &amp; ORM](/categories/database)

kjmtrue/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.

v4.1.4(3y ago)01.1k↓100%3MITPHP

Since Jan 18Pushed 3y agoCompare

[ Source](https://github.com/kjmtrue/laravel-cacheable)[ Packagist](https://packagist.org/packages/kjmtrue/laravel-cacheable)[ Docs](https://rinvex.com)[ RSS](/packages/kjmtrue-laravel-cacheable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (20)Used By (3)

Rinvex Cacheable
================

[](#rinvex-cacheable)

**Rinvex Cacheable** is a granular, intuitive, and fluent caching system for eloquent models. Simple, but yet powerful, plug-n-play with no hassle.

[![Packagist](https://camo.githubusercontent.com/6e110c6fb5c8bfd7f2da40a6684455cd4024a0ae1fb7ab6039759f0247323ef8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696e7665782f6c61726176656c2d636163686561626c652e7376673f6c6162656c3d5061636b6167697374267374796c653d666c61742d737175617265)](https://packagist.org/packages/rinvex/laravel-cacheable)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7e1cc5afd793b73c7082f11c422cf064203741054cb36323d22230c17c54f95a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72696e7665782f6c61726176656c2d636163686561626c652e7376673f6c6162656c3d5363727574696e697a6572267374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rinvex/laravel-cacheable/)[![Travis](https://camo.githubusercontent.com/ab1ad3afd41ffc2941472df1156b92229ec042bae28a44c9a56516494015601c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72696e7665782f6c61726176656c2d636163686561626c652e7376673f6c6162656c3d5472617669734349267374796c653d666c61742d737175617265)](https://travis-ci.org/rinvex/laravel-cacheable)[![StyleCI](https://camo.githubusercontent.com/c884687d1bc9eb5342293740ebd924a86728d55f1c7d9ced8de74550f4f58efc/68747470733a2f2f7374796c6563692e696f2f7265706f732f37393332313438362f736869656c64)](https://styleci.io/repos/79321486)[![License](https://camo.githubusercontent.com/cdeb0744002921df893674ceb33c2944302b995dc9004a8b87039f2242e3881b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72696e7665782f6c61726176656c2d636163686561626c652e7376673f6c6162656c3d4c6963656e7365267374796c653d666c61742d737175617265)](https://github.com/rinvex/laravel-cacheable/blob/develop/LICENSE)

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 &amp; Usage
------------------------

[](#installation--usage)

1. Install the package via composer:

    ```
    composer require rinvex/laravel-cacheable
    ```
2. Use the `\Rinvex\Cacheable\CacheableEloquent` in your desired model, and you're done!
3. Seriously, that's it!

Check the [`CacheableEloquent`](src/CacheableEloquent.php) source code for more awesome stuff if you need advanced control.

Optional Features
-----------------

[](#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
---------

[](#changelog)

Refer to the [Changelog](CHANGELOG.md) for a full history of the project.

Support
-------

[](#support)

The following support channels are available at your fingertips:

- [Chat on Slack](https://bit.ly/rinvex-slack)
- [Help on Email](mailto:help@rinvex.com)
- [Follow on Twitter](https://twitter.com/rinvex)

Contributing &amp; Protocols
----------------------------

[](#contributing--protocols)

Thank you for considering contributing to this project! The contribution guide can be found in [CONTRIBUTING.md](CONTRIBUTING.md).

Bug reports, feature requests, and pull requests are very welcome.

- [Versioning](CONTRIBUTING.md#versioning)
- [Pull Requests](CONTRIBUTING.md#pull-requests)
- [Coding Standards](CONTRIBUTING.md#coding-standards)
- [Feature Requests](CONTRIBUTING.md#feature-requests)
- [Git Flow](CONTRIBUTING.md#git-flow)

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within this project, please send an e-mail to [help@rinvex.com](help@rinvex.com). All security vulnerabilities will be promptly addressed.

About Rinvex
------------

[](#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
-------

[](#license)

This software is released under [The MIT License (MIT)](LICENSE).

(c) 2016-2020 Rinvex LLC, Some rights reserved.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

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

Every ~121 days

Recently: every ~219 days

Total

18

Last Release

1329d ago

Major Versions

v0.0.4 → v1.0.02018-10-05

v1.0.1 → v2.0.02019-03-03

v2.1.0 → v3.0.02019-09-22

v3.0.1 → v4.0.02020-03-15

PHP version history (5 changes)v0.0.1PHP ^7.0.0

v0.0.3PHP ^7.1.3

v2.0.0PHP ^7.2.0

v4.0.0PHP ^7.4.0

v4.1.0PHP ^7.4.0|^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5085f22e5f4981e925a44ad4ac1e8a941f0559f2e12a0d2a0c1087e4d940d2b?d=identicon)[kimtrien](/maintainers/kimtrien)

---

Top Contributors

[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (136 commits)")[![kimtrien](https://avatars.githubusercontent.com/u/9027134?v=4)](https://github.com/kimtrien "kimtrien (5 commits)")[![mohamed-hendawy](https://avatars.githubusercontent.com/u/16992890?v=4)](https://github.com/mohamed-hendawy "mohamed-hendawy (1 commits)")

---

Tags

laravelmodeleloquenttraitcachequeryfluentcacheablerinvexintuitivegranular

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kjmtrue-laravel-cacheable/health.svg)

```
[![Health](https://phpackages.com/badges/kjmtrue-laravel-cacheable/health.svg)](https://phpackages.com/packages/kjmtrue-laravel-cacheable)
```

###  Alternatives

[elipzis/laravel-cacheable-model

Automatic query-based model cache for your Laravel app

15546.1k](/packages/elipzis-laravel-cacheable-model)

PHPackages © 2026

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