PHPackages                             suppercup/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. suppercup/laravel-cacheable

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

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

1.0.1(5y ago)01052MITPHPPHP ^7.4.0|^7.3

Since Nov 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/supercup13/laravel-cacheable)[ Packagist](https://packagist.org/packages/suppercup/laravel-cacheable)[ Docs](https://rinvex.com)[ RSS](/packages/suppercup-laravel-cacheable/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (6)Versions (3)Used By (2)

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

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~25 days

Total

2

Last Release

1977d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c7bf629562eb0b0dc45d4359aa8fa8cd397103ef6ec37abb122b3bf50c28dba?d=identicon)[tanhien](/maintainers/tanhien)

---

Top Contributors

[![supercup13](https://avatars.githubusercontent.com/u/46367716?v=4)](https://github.com/supercup13 "supercup13 (3 commits)")

---

Tags

laravelmodeleloquenttraitcachequeryfluentcacheablerinvexintuitivegranular

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[elipzis/laravel-cacheable-model

Automatic query-based model cache for your Laravel app

15546.1k](/packages/elipzis-laravel-cacheable-model)[astrotomic/laravel-cachable-attributes

Allows to cache attribute accessor values in an easy way.

3240.0k](/packages/astrotomic-laravel-cachable-attributes)

PHPackages © 2026

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