1// users that are followed by this user
2public function following() {
3 return $this->belongsToMany(User::class, 'followers', 'follower_id', 'following_id');
4}
5
6// users that follow this user
7public function followers() {
8 return $this->belongsToMany(User::class, 'followers', 'following_id', 'follower_id');
9}
10