There was an error while loading. Please reload this page.
1 parent 2bcfef7 commit cba74cdCopy full SHA for cba74cd
app/Http/Resources/UserResource.php
@@ -21,7 +21,9 @@ public function toArray($request)
21
'email' => $this->email,
22
'postsCount' => $this->posts()->count(),
23
'followersCount' => $this->followers()->count(),
24
- 'followingCount' => $this->followings()->count()
+ 'followingCount' => $this->followings()->count(),
25
+ 'isFollowing' => $request->user() == $this->id
26
+ ? null : ($request->user() && $request->user()->isFollowing($this->resource))
27
];
28
}
29
0 commit comments