eloquent-best-practices
CommunityMaster Laravel Eloquent for peak performance.
Authorspraby
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill addresses common performance bottlenecks and pitfalls when using Laravel's Eloquent ORM, ensuring your database interactions are efficient and maintainable.
Core Features & Use Cases
- Query Optimization: Learn techniques like eager loading and selective column retrieval to reduce database load.
- Relationship Management: Understand best practices for defining and utilizing Eloquent relationships to avoid N+1 query problems.
- Mass Assignment & Type Safety: Secure your models and ensure data integrity with proper
fillable/guardedproperties and attribute casting. - Use Case: Optimize a slow-loading page that displays a list of posts and their authors by implementing eager loading for the author relationship.
Quick Start
Apply the eloquent-best-practices skill to refactor the provided code snippet to use eager loading for the 'user' relationship.
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: eloquent-best-practices Download link: https://github.com/spraby/api/archive/main.zip#eloquent-best-practices 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.