feat: add isFollowing
Laravel CI-CD / Tests Unitaires (push) Successful in 1m30s Details
Laravel CI-CD / Deploy with Kamal (push) Successful in 1m47s Details

This commit is contained in:
Leon Morival 2026-05-28 21:03:18 +02:00
parent c9dafc0f05
commit ea0d625bf9
1 changed files with 6 additions and 0 deletions

View File

@ -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),
],
]);