It's an easy fix if you can get new parts. Most makers provide parts, either themselves online, or from stores or online stores. You need the make and model number of the filter.
If the shaft has moved out of place, once you get a new one, pull it out, straight out, after removing the blade assembly, which usually just pulls off too. Needle nose pliers are helpful for taking out a shaft. Then put the new one in, it should seat into the hole at the bottom of the impeller well, nice and solid.
If the original impeller blades are still in good shape, slip them back onto it. If they have been damaged by the beating up, get a new impeller too and replace it as well.
It's usually very easy to do, most filters are made so that some sort of cover can be lifted or pulled off, and under it will be the impeller. Some models don't have a shaft, just a magnet and blades.
It's helpful to clean the impeller blades & the magnet and wipe out the impeller well when you clean the filter. Various things can get stuck in there, tiny snails, grains of sand or substrate and the simple buildup of biofilm and other crud will eventually interfere with good function of an impeller. They last longer if you keep them cleaned up.