PHPackages                             varunazad/laravel-query-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. varunazad/laravel-query-cache

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

varunazad/laravel-query-cache
=============================

Automatic query caching for Laravel with intelligent invalidation

1.0.1(11mo ago)017MITPHPPHP ^7.4|^8.0

Since Jul 31Pushed 11mo agoCompare

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

READMEChangelogDependencies (5)Versions (2)Used By (0)

Laravel Query Cache ⚡
=====================

[](#laravel-query-cache-)

[![Laravel Query Cache](https://camo.githubusercontent.com/6a43ab53b89ff2f875646668ad6e1e25057058ebf4a9057e1cbe5ff3cc6349c4/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f3135307835303f746578743d4c61726176656c51756572794361636865)](https://camo.githubusercontent.com/6a43ab53b89ff2f875646668ad6e1e25057058ebf4a9057e1cbe5ff3cc6349c4/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f3135307835303f746578743d4c61726176656c51756572794361636865)

> **Blazing-fast query optimization for Laravel**

---

### ✅ Supported Versions

[](#-supported-versions)

- Laravel: **8.x**, **9.x**, **10.x**
- PHP: **7.4+**, **8.0+**

---

🚀 Features
----------

[](#-features)

- ⚡ Automatic caching of Eloquent queries
- 💾 Configurable cache durations
- 📈 Tag-based cache invalidation
- 🔄 Support for all Laravel cache drivers
- 📊 Minimal configuration required
- 🔍 Works with existing Laravel applications
- 🧮 Query Cachin with pagination

---

🚀 Configuration-
----------------

[](#-configuration-)

**Publish the configuration file:**

```
php artisan vendor:publish --provider="VarunAzad\LaravelQueryCache\QueryCacheServiceProvider" --tag="config"

**This will create config/query-cache.php with the following options:**
return [
'default_ttl' => 3600, // Default cache time in seconds
'enabled' => env('QUERY_CACHE_ENABLED', true),
'prefix' => 'query_cache_',
'store' => env('QUERY_CACHE_STORE', null),
];

```

> **Basic Uses** Caching Queries use Varunazad\\QueryCache\\Facades\\QueryCache; in you controller / Cache a query for 60 minutes $users = User::cache(60)-&gt;where('active', true)-&gt;get();

```
// Use default cache time from config
$posts = Post::cache()->with('comments')->get();

```

> **Pagination query****add this trait in the model**use Varunazad\\QueryCache\\Traits\\Cacheable; use Cacheable;

```
    $users = User::with('wallet')->where('status',1)->withCachePaginate(2,60);
    return response()->json($users);

```

---

📦 Installation
--------------

[](#-installation)

```
composer require varunazad/laravel-query-cache
---

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance52

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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

Unknown

Total

1

Last Release

338d ago

### Community

Maintainers

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

---

Top Contributors

[![varunazad](https://avatars.githubusercontent.com/u/54257710?v=4)](https://github.com/varunazad "varunazad (10 commits)")[![varun-gh](https://avatars.githubusercontent.com/u/81137900?v=4)](https://github.com/varun-gh "varun-gh (4 commits)")

---

Tags

laravelperformanceeloquentQuery Cache

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/varunazad-laravel-query-cache/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.0k1](/packages/mike-bronner-laravel-model-caching)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)

PHPackages © 2026

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