PHPackages                             mixislv/laravel-model-self-cache - 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. mixislv/laravel-model-self-cache

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

mixislv/laravel-model-self-cache
================================

Laravel eloquent models cache helper

v2.0.0(4y ago)014MITPHPPHP ^7.1 || ^8.0

Since Jul 17Pushed 4y agoCompare

[ Source](https://github.com/mixisLv/laravel-model-self-cache)[ Packagist](https://packagist.org/packages/mixislv/laravel-model-self-cache)[ Docs](https://github.com/mixisLv/laravel-model-self-cache)[ RSS](/packages/mixislv-laravel-model-self-cache/feed)WikiDiscussions master Synced 2mo ago

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

Laravel eloquent models cache helper
====================================

[](#laravel-eloquent-models-cache-helper)

Install
-------

[](#install)

To install the package in your project, you need to require the package via composer:

```
composer require mixislv/laravel-model-self-cache
```

Basic usage
-----------

[](#basic-usage)

Add the trait to your model.

```
namespace App;

use mixisLv\SelfCache\Traits\SelfCache;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use SelfCache;

    /**
     * @see \App\Traits\SelfCache;
     * @var string
     */
    protected static $selfCacheKeyId = 'id';

    /**
     * @see \App\Traits\SelfCache;
     * @var int
     */
    protected static $selfCacheKeyExpiration = 134;

    // ...
}
```

Retrieve a model by its primary key.

```
    $user = User::getBySelfCacheId($userId);
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Recently: every ~253 days

Total

6

Last Release

1477d ago

Major Versions

v1.2.0 → v2.0.02022-04-23

PHP version history (2 changes)v1.0.0PHP ^7.1.3

v1.2.0PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2dcdf1ee2199a57fcdca07121fe369e806fa2bfadd7690409f26fcbb6c1ae134?d=identicon)[mixisLv](/maintainers/mixisLv)

---

Top Contributors

[![mixisLv](https://avatars.githubusercontent.com/u/3735128?v=4)](https://github.com/mixisLv "mixisLv (8 commits)")

---

Tags

laravelmodeleloquentcache

### Embed Badge

![Health badge](/badges/mixislv-laravel-model-self-cache/health.svg)

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[sebastiaanluca/laravel-boolean-dates

Automatically convert Eloquent model boolean attributes to dates (and back).

40111.7k1](/packages/sebastiaanluca-laravel-boolean-dates)

PHPackages © 2026

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