MWZ

MINDWAREZONE

intermediateLaravel

What relationship types are available in Eloquent?

Answer

Clear, interview-ready explanation

Eloquent supports one-to-one, one-to-many, and many-to-many relationships, along with their inverse forms such as belongsTo. It also supports has-one-through and has-many-through relationships for reaching related models through an intermediate model.

For models that can relate to more than one type of model, Eloquent provides polymorphic one-to-one, one-to-many, and many-to-many relationships. The relationship method on a model describes how the tables connect, while Eloquent handles query constraints, related model instances, and convenient persistence helpers.