feat: add isFollowing

This commit is contained in:
2026-05-28 21:03:18 +02:00
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),
],
]);