lc:cache-opportunities

Detect redundant queries and API calls in Laravel PHP code.

12|2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/edulazaro/laraclaude --skill lc-cache-opportunities
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lc:cache-opportunities
Source: https://github.com/edulazaro/laraclaude/tree/main/skills/cache-opportunities
Command: npx skills add https://github.com/edulazaro/laraclaude --skill lc-cache-opportunities

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill identifies performance bottlenecks caused by redundant database queries, expensive computations, and external API calls that are executed unnecessarily on every request.

Core Features & Use Cases

  • Automated Detection: Scans your codebase for repeated Eloquent queries, aggregate functions, and un-cached HTTP requests.
  • Intelligent Fixes: Suggests and applies Cache::remember wrappers with appropriate TTL values to reduce server load.
  • Use Case: If your dashboard displays aggregate counts from large tables on every page load, this skill will detect the inefficiency and help you implement a 120-second cache to significantly improve response times.

Quick Start

Run the cache opportunities skill to analyze the entire project and generate a report of potential performance improvements.

Frequently Asked Questions about lc:cache-opportunities

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find redundant Eloquent queries to optimize Laravel performance?

To optimize Laravel performance, you can statically analyze your PHP code to detect repeated Eloquent queries and expensive computations. This identifies performance bottlenecks in controllers, middleware, and Blade views that execute unnecessarily on every request.

What is the best way to cache database aggregate counts in Laravel?

The best way to cache database aggregate counts in Laravel is by applying Cache::remember wrappers with appropriate TTL values. This reduces server load by storing expensive aggregate function results instead of recalculating them on every page load.

Can I automatically detect un-cached external API calls in my Laravel application?

Yes, you can detect un-cached external API calls by performing static analysis of your PHP code. This scans your Laravel application for repeated execution patterns and suggests appropriate Cache::remember strategies to prevent unnecessary external requests.

How do I implement Cache::remember in Blade views and middleware?

You implement Cache::remember in Blade views and middleware by scanning for performance bottlenecks and applying suggested caching wrappers. This targets repeated execution patterns within your Laravel application and assigns appropriate TTL values for data caching.

Does static analysis of PHP code detect all performance bottlenecks in Laravel controllers?

Static analysis of PHP code detects performance bottlenecks in Laravel controllers by identifying redundant database queries and expensive computations. It specifically targets repeated execution patterns to suggest appropriate TTL values for data caching.