PHPackages                             vinks/laravel-memory-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. [Caching](/categories/caching)
4. /
5. vinks/laravel-memory-cache

ActiveLibrary[Caching](/categories/caching)

vinks/laravel-memory-cache
==========================

A memory-based simple cache system for Laravel Eloquent. The main goal is to prevent unrequired calls to DB.

1.0-beta3(7y ago)549MITPHPPHP &gt;=7.1.0

Since Sep 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Vinksyunit/laravel-memory-cache)[ Packagist](https://packagist.org/packages/vinks/laravel-memory-cache)[ Docs](https://github.com/Vinksyunit/laravel-memory-cache)[ RSS](/packages/vinks-laravel-memory-cache/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Laravel Memory Cache
====================

[](#laravel-memory-cache)

The main goal of this package is to prevent useless calls to the database which could be remembered easily in memory.

The trait `SimpleMemoryCached` is watching for new instances of the model from the database and remembers them in a cache store in memory. If you ask for a model using `find` and his primary key, it will check in the store before requesting it to database.

I know it is useless if good pratices are made accessing your models instances, but it can help the optimization of smal projects.

```
\App\CachedModel::where('id', '
