PHPackages                             lewis-neiland/laravel-cacheable-model - 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. [Caching](/categories/caching)
4. /
5. lewis-neiland/laravel-cacheable-model

ActiveLibrary[Caching](/categories/caching)

lewis-neiland/laravel-cacheable-model
=====================================

A package to manage caching Eloquent models and their relationships.

0.1.2(1y ago)017MITPHPPHP &gt;=7.4

Since Jun 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lewis-neiland/laravel-cacheable-model)[ Packagist](https://packagist.org/packages/lewis-neiland/laravel-cacheable-model)[ RSS](/packages/lewis-neiland-laravel-cacheable-model/feed)WikiDiscussions main Synced 1mo ago

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

Easy Cacheable Models for Laravel (for `file` driver)
=====================================================

[](#easy-cacheable-models-for-laravel-for-file-driver)

Introduction
------------

[](#introduction)

This is a simple solution to streamline using the Cache facade with Eloquent models and their relationships, primarily with the limitations of the default `file` driver. It provides methods to easily generate, retrieve and flush cached instances of Models in addition to any relationships in their model file specified via a function. Cache for a given model is automatically flushed upon any changes along with any cached relationships.

This was created for an earlier project, so that we could easily implement caching in our preestablished systems. As such, you can either use it as reference for your own software or improve on it.

All methods have appropriate documentation.

**Note: Only supports caching of relationships that use an Eloquent Model.**

Install via Composer (WIP):
---------------------------

[](#install-via-composer-wip)

In your Laravel project's root directory, run: `composer require lewis-neiland/laravel-cacheable-model`. This will install the needed files to your project.

Getting Started:
----------------

[](#getting-started)

### Importing

[](#importing)

In any Eloquent Model file you wish to use this for, add the following as seen here:

```
use CacheableModel;

class Model
{
    use CacheableModel;
}

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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 ~4 days

Total

3

Last Release

689d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97b8ea059353b25fd5fe4612c1e2019874ea75216ec72e970020181ca4912a4b?d=identicon)[lewis-neiland](/maintainers/lewis-neiland)

---

Top Contributors

[![lewis-neiland](https://avatars.githubusercontent.com/u/125032439?v=4)](https://github.com/lewis-neiland "lewis-neiland (37 commits)")

### Embed Badge

![Health badge](/badges/lewis-neiland-laravel-cacheable-model/health.svg)

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

###  Alternatives

[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

2.4k4.8M26](/packages/genealabs-laravel-model-caching)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[mikebronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k127.1k1](/packages/mikebronner-laravel-model-caching)[laragear/cache-query

Remember your query results using only one method. Yes, only one.

272122.8k](/packages/laragear-cache-query)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k2.0k1](/packages/mike-bronner-laravel-model-caching)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

2057.2k](/packages/iazaran-smart-cache)

PHPackages © 2026

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