eloquent-relationships

Installation
SKILL.md

Eloquent Relationships

When to use

  • The user has slow pages or a flood of queries from accessing a relationship inside a loop and needs to eager load with with(), load(), or loadMissing().
  • The user needs a many-to-many association through a pivot table — users and roles, posts and tags — with belongsToMany and optional pivot columns.
  • The user needs to relate two Eloquent models — a user has many posts, a post belongs to a user, an order has one invoice.
  • The user needs one model (comments, images) to belong to several parent types and reaches for morphTo/morphMany polymorphic relations.

When NOT to use

Installs
1
GitHub Stars
3
First Seen
Jul 3, 2026
eloquent-relationships — anyorgname/php-skills