PHPackages                             harun1302123/laravel-smart-cache-analyzer - 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. harun1302123/laravel-smart-cache-analyzer

ActiveLibrary[Caching](/categories/caching)

harun1302123/laravel-smart-cache-analyzer
=========================================

Intelligent cache analysis and optimization for Laravel applications

v1.0.0(5mo ago)02MITPHPPHP ^8.1

Since Jan 13Pushed 5mo agoCompare

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

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

Laravel Smart Cache Analyzer
============================

[](#laravel-smart-cache-analyzer)

Intelligent cache analysis and optimization for Laravel applications. Automatically detect caching opportunities, analyze cache performance, and optimize your application's caching strategy.

Features
--------

[](#features)

- 🔍 **Auto-detect Cacheable Queries** - Identify slow and repeated queries that should be cached
- 📊 **Cache Analytics Dashboard** - Visual metrics showing cache effectiveness
- 🎯 **Smart Expiration Recommendations** - Data-driven suggestions for optimal TTLs
- 🔥 **Cache Warming** - Pre-populate cache before expiration
- 🧹 **Dead Cache Cleanup** - Identify and remove unused cache keys
- 💰 **Performance Metrics** - Track database load reduction and cost savings

Installation
------------

[](#installation)

Install via Composer:

```
composer require harun1302123/laravel-smart-cache-analyzer
```

Publish the configuration:

```
php artisan vendor:publish --provider="SmartCache\Analyzer\SmartCacheServiceProvider"
```

Run migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

The configuration file will be published to `config/smart-cache.php`:

```
return [
    'enabled' => env('SMART_CACHE_ENABLED', true),
    'dashboard_path' => 'smart-cache',
    'slow_query_threshold' => 100, // milliseconds
    'analyze_interval' => 3600, // seconds
];
```

Usage
-----

[](#usage)

### Dashboard

[](#dashboard)

Access the analytics dashboard at:

```
http://your-app.test/smart-cache

```

### CLI Commands

[](#cli-commands)

Analyze cache performance:

```
php artisan cache:analyze
```

Clean dead cache keys:

```
php artisan cache:cleanup
```

Warm cache:

```
php artisan cache:warm
```

### Programmatic Usage

[](#programmatic-usage)

```
use SmartCache\Analyzer\Facades\SmartCache;

// Get cache statistics
$stats = SmartCache::getStats();

// Analyze a specific query
SmartCache::analyzeQuery($query);

// Get caching recommendations
$recommendations = SmartCache::getRecommendations();
```

How It Works
------------

[](#how-it-works)

1. **Query Monitoring** - Listens to database queries and tracks execution times
2. **Pattern Detection** - Identifies queries that are executed frequently
3. **Analytics** - Calculates hit/miss ratios and performance metrics
4. **Recommendations** - Suggests optimal caching strategies based on usage patterns
5. **Automation** - Optionally auto-apply caching strategies

Dashboard Preview
-----------------

[](#dashboard-preview)

The dashboard provides:

- Real-time cache hit/miss ratio
- Top cacheable queries
- Cache memory usage
- TTL recommendations
- Cost savings calculator

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.0 or higher

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT License. See LICENSE file for details.

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

[](#contributing)

Contributions are welcome! Please see CONTRIBUTING.md for details.

Support
-------

[](#support)

For issues and questions, please use the GitHub issue tracker.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance70

Regular maintenance activity

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

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

171d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/35065199?v=4)[MD HARUNUR RASHID](/maintainers/Harun1302123)[@Harun1302123](https://github.com/Harun1302123)

---

Top Contributors

[![harunur8s](https://avatars.githubusercontent.com/u/213733222?v=4)](https://github.com/harunur8s "harunur8s (2 commits)")[![Harun1302123](https://avatars.githubusercontent.com/u/35065199?v=4)](https://github.com/Harun1302123 "Harun1302123 (1 commits)")

---

Tags

laravelperformancecacheoptimizationanalyticsanalyzer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/harun1302123-laravel-smart-cache-analyzer/health.svg)

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

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.0M69](/packages/spatie-laravel-responsecache)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

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

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)

PHPackages © 2026

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