Skip to content

Commit cba74cd

Browse files
committed
WIP - Update User API
1 parent 2bcfef7 commit cba74cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Http/Resources/UserResource.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public function toArray($request)
2121
'email' => $this->email,
2222
'postsCount' => $this->posts()->count(),
2323
'followersCount' => $this->followers()->count(),
24-
'followingCount' => $this->followings()->count()
24+
'followingCount' => $this->followings()->count(),
25+
'isFollowing' => $request->user() == $this->id
26+
? null : ($request->user() && $request->user()->isFollowing($this->resource))
2527
];
2628
}
2729
}

0 commit comments

Comments
 (0)