laravel:eloquent-relationships
CommunityMaster Eloquent relationships & loading.
Authormeistro57
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps developers efficiently manage and query data relationships in Laravel applications, preventing common performance pitfalls like the N+1 query problem.
Core Features & Use Cases
- Define Relationships: Clearly express one-to-one, one-to-many, and many-to-many associations between Eloquent models.
- Efficient Data Loading: Utilize eager loading (
with,load) and constrained eager loading to fetch related data with minimal database queries. - Aggregate Data: Efficiently load counts, sums, and other aggregates from related models (
withCount,withSum). - Pivot Table Operations: Safely manage many-to-many relationships using
syncandsyncWithoutDetaching. - Chunking: Process large datasets efficiently using
lazy()for memory-friendly iteration.
Quick Start
Load posts with their authors and comment counts, then paginate the results.
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: laravel:eloquent-relationships Download link: https://github.com/meistro57/chat_bridge/archive/main.zip#laravel-eloquent-relationships 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 223,000+ vetted skills library on demand.