Peer caring and resilience improved the SWB of both nursing and medical students.
Resilience improved SWB through peer caring for both nursing and medical students.
Higher resilience in medical students enhanced the positive effects of peer caring on SWB.