/**
  * @param Request $request
  * @param Team $team
  */
 private function syncTeamMembers(Request $request, Team $team)
 {
     $members = [];
     foreach ($request['members'] as $member) {
         $members[(int) $member['id']] = ['event_id' => $request['event_id']];
     }
     $team->members()->sync($members);
 }