Is it possible to set a max quantity on a specific product within a cart?

E.g. I wanna only allow the amount of stock left of my product for the max quantity. So if I only have 5 left, a user should only be able to add 5.

Thanks

Nevermind. Realized you can pass data-max-quantity