id()) ->where('followee_id', $user->id) ->first(); if ($existing) { $existing->delete(); return response()->json(['following' => false]); } Followee::create([ 'user_id' => auth()->id(), 'followee_id' => $user->id, ]); return response()->json(['following' => true]); } }