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(2y ago)017MITPHPPHP &gt;=7.4

Since Jun 13Pushed 2y 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 2d 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

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

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

742d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/125032439?v=4)[Lewis Neiland](/maintainers/lewis-neiland)[@lewis-neiland](https://github.com/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

[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[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.

21111.6k](/packages/iazaran-smart-cache)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)

PHPackages © 2026

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