Laravel Inverse of Has Many Through Relationship (Belongs to Many Through?)

The Laravel relationship of Has Many Through is not in the docs, but it seems obvious once you read it. Thanks to @foxted on Laracast.


class Post extends Eloquent{

    ...

    public function country(){
        return $this->user->country;
    }
}

I should’ve been able to figure this one out without Google but… 🤦‍♂️

Leave a Comment