In a cycled 5 gallon, you should do water changes (not 100% necessarily, but a water change nevertheless) weekly at least. If it's one week, you could do a big water change before leaving, then do one when you get back. Not sure if there would be any ammonia spikes/anything in that time. If it's two weeks and you have the betta fed ~5 pellets a day, I feel like there might be some water quality issues without a water change inbetween that period.
I think the best course to go is just to not feed the fish during the vacation. A healthy adult betta can go 1-2 weeks without food. Plus, you wouldn't have to worry about water quality issues.