PHPackages                             chilltvpack/laravel-caching-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. chilltvpack/laravel-caching-model

ActiveLibrary[Caching](/categories/caching)

chilltvpack/laravel-caching-model
=================================

A simple cache library for laravel eloquent model

00PHP

Since Nov 28Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

laravel-caching-model
=====================

[](#laravel-caching-model)

- Simple package for caching laravel eloquent model
- Support retrieve model stored in cache store by id (or other primary key)

Usage
=====

[](#usage)

1. Implement Cacheable interface then use HasCache trait:

```
use chilltvpack\CachingModel\Contracts\Cacheable;
use chilltvpack\CachingModel\HasCache;

class Setting extends Model implements Cacheable
{
    use HasCache;

    ...
}
```

2. use `fromCache()` static method to retrieve model data from cache storage

```
$cachedInstance = Setting::fromCache()->find($key);
```

Available methods:
==================

[](#available-methods)

1. public static function primaryCacheKey(): string;

- Return primary key for creating cache key
- Default: id

2. public static function getCacheKey($id): string;

- Return cache key for specific instance with primary key is $id

3. public static function cacheTimeout(): int;

- Return cache timeout

4. public function scopeCacheWithRelation($query);

- Specific relationship will cache together model

```
public function scopeCacheWithRelation($query)
{
    return $query->with('relationship:id);
}
```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a05bb86e84a692a9b8456b4804d30ddde350c63301c3106f2634d884dc7ead7?d=identicon)[syle](/maintainers/syle)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/chilltvpack-laravel-caching-model/health.svg)

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

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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