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(3mo ago)02MITPHPPHP ^8.1

Since Jan 13Pushed 3mo 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 1mo ago

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

35

—

LowBetter than 79% of packages

Maintenance78

Regular maintenance activity

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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

119d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9df247aa7374ef6c5078131ccdf1a078962fb1404b44c515f3c1ce2e3c8ce842?d=identicon)[Harun1302123](/maintainers/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.8k8.2M51](/packages/spatie-laravel-responsecache)[anahkiasen/flatten

A package for the Illuminate framework that flattens pages to plain HTML

33313.0k](/packages/anahkiasen-flatten)[omaralalwi/lexi-translate

Laravel translation package with morph relationships and caching.

754.3k2](/packages/omaralalwi-lexi-translate)[michele-angioni/support

Support is a Laravel package which promotes the use of best practices and design patterns.

181.4k1](/packages/michele-angioni-support)

PHPackages © 2026

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