feat: add isFollowing
This commit is contained in:
parent
c9dafc0f05
commit
ea0d625bf9
|
|
@ -47,6 +47,12 @@ class PublicUserProfileController extends Controller
|
|||
->wherePivot('status', FollowStatus::Accepted)
|
||||
->count(),
|
||||
],
|
||||
'isFollowing' => $request->user()
|
||||
? $request->user()->following()
|
||||
->where('following_id', $user->id)
|
||||
->whereIn('status', [FollowStatus::Accepted, FollowStatus::Pending])
|
||||
->exists()
|
||||
: false,
|
||||
'meals' => MealPostsResource::collection($meals)->resolve($request),
|
||||
],
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue