Performance eager loading

From jpcaparas/superpowers-laravel · View interactive version

Performance eager loading is an AI agent skill from the GitHub repository jpcaparas/superpowers-laravel. Prevent N+1 queries by eager loading; enable lazy-loading protection in non-production; choose selective fields

How to use this skill

Skill file

Eager Loading and N+1 Prevention

Load Relations Explicitly

Post::with(['author', 'comments'])->paginate();

Guard Against Lazy Loading in Dev/Test

Add to a service provider (non-production):

Model::preventLazyLoading(! app()->isProduction());

Verify

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.