Toddler spitting out medicine?

👪💖

My 19 mo recently started keeping his medicine in his mouth then likes to spit it out and laugh. I don’t know how to prevent this. Any advice would be appreciated :)