PHPackages                             singlequote/laravel-cacher - 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. singlequote/laravel-cacher

ActiveLibrary[Caching](/categories/caching)

singlequote/laravel-cacher
==========================

A powerfull cacher based on laravels file cache driver

1.0.1(3y ago)024.8k↑233.3%11MITPHP

Since Sep 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/singlequote/laravel-cacher)[ Packagist](https://packagist.org/packages/singlequote/laravel-cacher)[ Docs](https://github.com/singlequote/laravel-cacher)[ RSS](/packages/singlequote-laravel-cacher/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)DependenciesVersions (11)Used By (1)

Laravel Cacher
==============

[](#laravel-cacher)

A powerful cache trait based on Laravel's file cache driver

[![Latest Version on Packagist](https://camo.githubusercontent.com/4d6b13ef250f14988dbb80bf7f9dda819850e719ccc39a6041c69fc2827ebd03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e676c6571756f74652f6c61726176656c2d6361636865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/singlequote/laravel-cacher)[![Total Downloads](https://camo.githubusercontent.com/38d0c5602b8cf1ce8754a2b54b67678a92ce8d44ea034b5d51d8f5a32937501c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73696e676c6571756f74652f6c61726176656c2d6361636865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/singlequote/laravel-cacher)

### Installation

[](#installation)

```
composer require singlequote/laravel-cacher
```

Usage
-----

[](#usage)

### Model Caching

[](#model-caching)

Sometimes you just want to cache Eloquent Model results. With Model caching you can, without making a mess in your code. Just include the `cacher` trait within your model:

```
namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable; //remember(); //remember(3600); //rememberForever();
```

### Custom prefix

[](#custom-prefix)

By default the cache prefix is unique. You can use your own prefix by calling the `prefix` method

```
    $users = User::whereEmail('foo@bar.world')->prefix("all-users")->remember(); //prefix all-users

    cache()->forget("all-users");
```

### All methods

[](#all-methods)

```
   $users = User::whereEmail('foo@bar.world')->remember(/*3600*/); //for 1 hour -  default 7 days
   $users = User::whereEmail('foo@bar.world')->rememberForever(); //for ever

   //find
   $user = User::whereEmail('foo@bar.world')->findAndRemember(1, /*3600*/);
   $user = User::whereEmail('foo@bar.world')->findAndRememberForever(1);

   //first
   $user = User::whereEmail('foo@bar.world')->firstAndRemember(/*3600*/);
   $user = User::whereEmail('foo@bar.world')->firstAndRememberForever();

   //counting
   $user = User::whereEmail('foo@bar.world')->rememberCount(/*3600*/);
   $user = User::whereEmail('foo@bar.world')->rememberCountForever();

   //paginating
   $user = User::whereEmail('foo@bar.world')->paginateAndRemember(20, /*3600*/); //return 20 results
   $user = User::whereEmail('foo@bar.world')->paginateAndRememberForever(20); //return 20 results
```

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

[](#contributing)

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

Postcardware
------------

[](#postcardware)

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Quotec, Traktieweg 8c 8304 BA, Emmeloord, Netherlands.

Credits
-------

[](#credits)

- [Wim Pruiksma](https://github.com/wimurk)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 97.2% 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 ~139 days

Recently: every ~301 days

Total

10

Last Release

1232d ago

Major Versions

0.0.9 → 1.0.02021-07-13

PHP version history (2 changes)0.0.1PHP ^7.0

1.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14072334?v=4)[Wimurk](/maintainers/wimurk)[@wimurk](https://github.com/wimurk)

---

Top Contributors

[![wimurk](https://avatars.githubusercontent.com/u/14072334?v=4)](https://github.com/wimurk "wimurk (35 commits)")[![zack6849](https://avatars.githubusercontent.com/u/1343898?v=4)](https://github.com/zack6849 "zack6849 (1 commits)")

---

Tags

laravelcachetagscacher

### Embed Badge

![Health badge](/badges/singlequote-laravel-cacher/health.svg)

```
[![Health](https://phpackages.com/badges/singlequote-laravel-cacher/health.svg)](https://phpackages.com/packages/singlequote-laravel-cacher)
```

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

974169.8k2](/packages/awssat-laravel-visits)[swayok/alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

202570.3k8](/packages/swayok-alternative-laravel-cache)[byerikas/cache-tags

Allows for Redis/Valkey cache flushing multiple tagged items by a single tag.

1418.0k](/packages/byerikas-cache-tags)[dragon-code/laravel-cache

An improved interface for working with cache

6845.6k10](/packages/dragon-code-laravel-cache)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

13011.9k](/packages/nexxai-laravel-cfcache)[henzeb/laravel-cache-index

Flexible replacement for tags

1215.5k](/packages/henzeb-laravel-cache-index)

PHPackages © 2026

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