Starting from the very obvious things:Hello, recently my chickens have been eating their eggs right after they lay them is their any way to prevent this from happening?
--make sure the chickens have food and water available. If they are hungry or thirsty, of course they are going to eat eggs.
--make sure they have enough calcium, because eggs with soft shells break easily and then of course the chickens eat those eggs. A dish of oyster shell is good, even if they are eating a layer feed with high calcium. You can also give them the shells of any eggs you eat.
--make sure the food is adequate. If it's less than about 18% protein, consider providing a higher-protein food.
--having fake eggs in the nestboxes sometimes helps, because the chickens can keep pecking and not get anything tasty to eat. But if the chickens are eating eggs immediately after the eggs are laid, it will probably not help in your case.
--roll away nestboxes, as several people have suggested, should solve the problem. If the eggs have soft shells that break before they can roll, you would still need to address that.
--butchering the main egg-eaters, or butchering them all and getting new chickens, is a drastic step but does also work. If the egg eating was caused by soft shells, or not enough protein, or not enough food, you need to fix that before the new chickens start eating eggs too. But if the problem was caused by one clever chicken figuring out that eggs taste good and then she showed the others, a completely new batch of chickens will solve the problem.