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

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

sormagec/laravel-mongo-cacheable
================================

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.

v1.0.4(7y ago)06MITPHPPHP ^7.1.3

Since Jan 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/bsormagec/laravel-cacheable)[ Packagist](https://packagist.org/packages/sormagec/laravel-mongo-cacheable)[ RSS](/packages/sormagec-laravel-mongo-cacheable/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (7)Versions (10)Used By (0)

Sormagec MongoDB Cacheable
==========================

[](#sormagec-mongodb-cacheable)

**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?

Installation &amp; Usage
------------------------

[](#installation--usage)

1. Install the package via composer:

    ```
    composer require sormagec/laravel-cacheable
    ```
2. Use the `\Sormagec\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;
```

License
-------

[](#license)

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

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

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 95.3% 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 ~90 days

Recently: every ~25 days

Total

9

Last Release

2726d ago

Major Versions

v0.0.4 → v1.0.02018-10-05

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

v0.0.3PHP ^7.1.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46748527?v=4)[sormagec](/maintainers/sormagec)[@sormagec](https://github.com/sormagec)

---

Top Contributors

[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (101 commits)")[![bsormagec](https://avatars.githubusercontent.com/u/965219?v=4)](https://github.com/bsormagec "bsormagec (5 commits)")

---

Tags

laravelmodeleloquenttraitcachequeryfluentcacheableintuitivegranularsormagec

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.0M90](/packages/mongodb-laravel-mongodb)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2111.2M16](/packages/reedware-laravel-relation-joins)[esensi/model

The base model traits of Esensi

20067.0k1](/packages/esensi-model)[elipzis/laravel-cacheable-model

Automatic query-based model cache for your Laravel app

15851.1k](/packages/elipzis-laravel-cacheable-model)[ntanduy/cloudflare-d1-database

Cloudflare D1 database driver for Laravel — full Eloquent &amp; Query Builder support.

266.8k](/packages/ntanduy-cloudflare-d1-database)[astrotomic/laravel-cachable-attributes

Allows to cache attribute accessor values in an easy way.

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

PHPackages © 2026

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