0062-laravel-performance-eager-loading
CommunityEliminate N+1 queries with safe eager loading.
Software Engineering#query optimization#laravel#performance debugging#eager loading#n+1 queries#lazy loading prevention
AuthorMrJmpl3
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Laravel applications often suffer severe performance slowdowns when relations are loaded lazily, causing N+1 query patterns that multiply database calls per record.
Core Features & Use Cases
- Prevent N+1 queries with eager loading: Eager load relations explicitly (e.g., author, comments) to reduce query counts.
- Use lazy-loading protection in non-production: Enable safeguards so accidental lazy loading is caught during development and testing.
- Load only the fields you need: Select only required columns for both base models and their relations to minimize data transfer and processing.
Quick Start
Add explicit eager loading to your queries (for example, load the author and comments relations when paginating posts) and enable lazy-loading prevention outside production.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: 0062-laravel-performance-eager-loading Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0062-laravel-performance-eager-loading Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.