diff --git a/app/Profile.php b/app/Profile.php new file mode 100644 index 000000000..aab29148b --- /dev/null +++ b/app/Profile.php @@ -0,0 +1,37 @@ +hasMany(Status::class); + } + + public function following() + { + return $this->hasManyThrough( + Profile::class, + Follower::class, + 'profile_id', + 'id', + 'id', + 'id' + ); + } + + public function followers() + { + return $this->hasManyThrough( + Profile::class, + Follower::class, + 'following_id', + 'id', + 'id', + 'id' + ); + } +}