midLaravel
What are Laravel Eloquent relationships?
Updated May 16, 2026
Short answer
Eloquent relationships define how database models are connected.
Deep explanation
Laravel supports one-to-one, one-to-many, many-to-many, and polymorphic relationships. These relationships allow developers to retrieve related data using expressive methods instead of manual joins. Internally, Eloquent translates these relationships into optimized SQL queries.
Real-world example
Used in blog systems where users have many posts and comments.
Common mistakes
- N+1 query problem caused by not eager loading relationships.
Follow-up questions
- What is eager loading?
- What is N+1 problem?