Eloquent provides one Relation type for far related tables –
hasManyThrough. However it works only with with cascade of
hasOne/hasMany relations and you can use it only for 2 levels of nesting, while sometimes you need more.
Imagine, that you want to get the posts for logged-in user, having this setup:
// User subscribed to many tags
User belongsToMany Tag
// Post migh be tagged by many tags
Tag belongsToMany Post
Now, because there is no built-in method for such case, you would probably think of getting all the
tags, looping through them, and merging all the
posts from each tag. While this would work, it would be cumbersome, so let’s make it easier!